D. Allen's Xor(z)
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

Allen has an array $$$a$$$ with $$$n$$$ elements. He will perform the following operation as many times as he likes:

Select two distinct elements of the array and a number $$$x$$$, and bitwise XOR both elements by $$$x$$$. Formally, Allen can choose indices $$$i,j$$$ of his array ($$$1\leq i,j \leq n, i\neq j$$$) and a number $$$x$$$, and then set $$$a_i = a_i \oplus x$$$ and $$$a_j = a_j \oplus x$$$, where $$$\oplus$$$ denotes the bitwise XOR operation.

What is the minimum possible value of the maximum element in Allen's array after any number of operations?

Input

The first line contains one integer $$$t$$$ $$$(1 \leq t \leq 10^4)$$$ — the number of test cases.

Each test case consists of a number $$$n$$$ $$$(2 \leq n \leq 2\cdot 10^5)$$$ – the size of the array.

The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ $$$(0 \leq a_i < 2^{30})$$$, the numbers in Allen's array.

It is guaranteed that the sum of all $$$n$$$ does not exceed $$$2\cdot 10^5$$$.

Output

For each test case, output the minimum possible value of the maximum element in Allen's array.

Example
Input
2
5
1 4 2 5 7
3
1 2 3
Output
4
0
Note

In the first case, selecting $$$(i,j) = (4,5)$$$ and $$$x=1$$$ and then $$$(i,j) = (3,5)$$$ and $$$x=2$$$ results in $$$4$$$ being the maximum element. It can be shown that this is the minimum possible value of the maximum.

In the second case, selecting $$$(i,j) = (1,3)$$$ and $$$x=1$$$ and then $$$(i,j) = (2,3)$$$ and $$$x=2$$$ results in $$$0$$$ being the maximum element. It can be shown that this is the minimum possible value of the maximum.