HACKEREATRH Xor Problem

Hello,
Can anybody help me to understand how can I solve this, As Editorial is not given on the site?
Adhoc approch not working.

Problem statement: https://www.hackerearth.com/problem/algorithm/strange-xor-13414ed5/description/

Thanks in advance.