B. Concealing Choices
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Alice has $$$n$$$ positive integers $$$a_1, a_2, \dots, a_n$$$. Bob wants to secretly modify these integers by picking a positive integer $$$x$$$ and replacing $$$a_i$$$ with $$$a_i | x$$$ for every valid $$$i$$$. Here, $$$|$$$ represents the bitwise OR operation.

Alice doesn't notice any change if the resulting sequence is a permutation of $$$a$$$. Find the number of choices of $$$x$$$ such that Bob's modification goes unnoticed by Alice.

Input

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

The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 2 \cdot 10^5$$$) — the number of integers that Alice has.

The second line contains $$$n$$$ space separated integers $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10^9$$$).

It is guaranteed that the sum of $$$n$$$ over all test cases doesn't exceed $$$2 \cdot 10^5$$$.

Output

For each test case, print a single integer on a new line, the answer to the problem.

Example
Input
2
5
15 9 11 25 13
4
3 5 9 17
Output
3
1