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 \(A_1, A_2, ... , A_N\) , where \(A_i\) denotes the value in the \(i^{th}\) leaf.
Output Format
For each of the T test cases, print the value at the root node in a new line.
Constraints
\( 1 \le T \le 100 \)
\( 2 \le N \le 1000 \)
\( 1 \le A_i \le 10^9 \)