You are given an array $$$a$$$ of $$$n$$$ non-negative integers.
You need to split its elements into 2 non-empty sets $$$s_1$$$ and $$$s_2$$$, such that each element belongs to exactly one set. The value of the split is defined as the value of the following formula:
$$$$$${|and(s_1) - and(s_2)|}$$$$$$
where $$$and(s_1)$$$, $$$and(s_2)$$$ are the bitwise AND of the elements of the first and the second set in order, and $$$|x|$$$ is the absolute value of $$$x$$$.
You need to output the maximum value of a split.
The first line contains a single integer $$$t$$$ $$$(1 \le t \le 10^5)$$$ — the number of testcases.
The first line of each testcase contains a single integer $$$n$$$ $$$(2 \le n \le 10^5)$$$ — the length of array $$$a$$$.
The following line contains $$$n$$$ non-negative integers $$$(a_1, \space a_2, \space ..a_n)$$$ $$$(1 \le a_i \le 10^9)$$$ — the elements of the array.
It is guaranteed that the sum of $$$n$$$ overall testcases does not exceed $$$10^5$$$.
For each testcase you need to output the maximum value of a split as described in the problem statement.
1107 6 2 1 8 2 8 1 1 7
8
| Name |
|---|


