Consider a complete binary tree with N leaves. Every node of the tree stores a positive value. The tree has been built in such a way that every internal node of the tree has a value that is xor of the values of it's two children.
You are given N integers, denoting the values of the N leaves. Find and print the value at the root node.
It can be proven that this value can be uniquely determined.
Input Format
The first line will consist of an integer T, denoting the number of test cases.
Each of the T test cases that follow, will consist of two lines.
The first line for each test case will consist of the integer N.
The second line for each test case will consist of N space separated integers A1,A2,...,AN , where Ai denotes the value in the ith leaf.
Output Format
For each of the T test cases, print the value at the root node in a new line.
Constraints
1≤T≤100
2≤N≤1000
1≤Ai≤109
In the first case, for any complete binary tree that you can create with 3 leaves having the given values, the value at the root will be 2.
For the second case, you can see a sample Complete Binary Tree with the values in the leaves as given in the input.