XOR Circuit - Graph Problem , How to solve it?

Problem: CodeChef: Practical coding for everyone
I can’t find any editorial for this problem.
Can someone provide a solution to this problem ?