You are given a set S of distinct positive integers of size n (n is always even). Print the minimum positive integer k that is greater than 0 such that after replacing each element e of the set S with e⊕k, set S remains the same.
Print -1 if there is no such k.
Note: It is guaranteed that n2 is odd.
Input format
Output format
Print t lines each containing a single line that contains k.
By performing the XOR of k with each element we get the given set S
5⊕3=6
6⊕3=5
13⊕3=14
14⊕3=13
9⊕3=10
10⊕3=9
S' = {6,5,14,13,10,9} which is same as S={5,6,13,14,9,10}