You are given n integers as a1, a2, a3, a4, …, an.
First of all, 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
Input starts with an integer T (0<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).
Output
For each case, print a single line containing a single integer which denotes the final result.