Given an array with n integers, assume f(S)f(S)f(S) as the result of executing xor operation among all the elements of set SSS. e.g. if S={1,2,3}S = {1,2,3}S={1,2,3} then f(S)=0f(S) = 0f(S)=0.
your task is: calculate xor of all f(s)f(s)f(s), here s⊆Ss \subseteq Ss⊆S.
Input
This problem has multi test cases. First line contains a single integer T(T≤20)T(T\leq 20)T(T≤20) which represents the number of test cases. For each test case, the first line contains a single integer number n(1≤n≤1,000)n(1\leq n \leq 1,000)n(1≤n≤1,000) that represents the size of the given set. then the following line consists of nnn different integer numbers indicate elements(≤109\leq 10^9≤109) of the given set.
Output
For each test case, print a single integer as the answer.
Sample Input
1
3
1 2 3
Sample Output
0
In the sample,S={1,2,3}S = \{1, 2, 3\}S={1,2,3}, subsets of SSS are: ∅\varnothing∅, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}