You are given n integers as a1, a2, a3, a4, . . . . . . . ., an.
Firstly, you have to find the XORs of all of the pairs that can be formed from the given integers. That means, XOR (ai, aj) where 1 ≤ i, j ≤ n and i < j.
Finally, your ultimate goal is to find the cumulative XOR of previously found XORs of each pair.
Input starts with an integer T (≤ 50), denoting the number of test cases.
The first line of each test case contains an integer n (2 ≤ n ≤ 105). The next line contains n space separated integers ai (1 ≤ i ≤ n, 1 ≤ ai ≤1000).
For each case, print a single line containing a single integer which denotes the final result.
2 2 3 4 5 1 2 2 4 5