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.
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$$$.
For each test case, print a single integer on a new line, the answer to the problem.
2515 9 11 25 1343 5 9 17
3 1
| Name |
|---|


