A. Rama and Cats Syndrome
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Bagheera is getting bigger by the day; he is a big boy now. Rama always tries to get him the best food there is.

There are $$$n$$$ bags of food; the $$$i$$$-th bag has food with value $$$a_i$$$. Let's say that the value of bags she buys is the bitwise OR of food values in them.

Rama can only buy $$$n - 1$$$ bags of food, what's the maximum value of food she can buy?

Input

The first line contains an integer $$$t$$$ $$$(1 \leq t \leq 10^3)$$$ – the number of test cases.

The first line of each test case contains an integer $$$n$$$ $$$(2 \leq n \leq 2 \cdot 10^5)$$$.

The second line of the test case contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ $$$(1 \leq a_i \leq 10^9)$$$.

Output

For each test case, print an integer that represents the maximum value of food she can buy.

Examples
Input
3
3
1 2 3
4
1 2 2 2
5
8 2 3 5 11
Output
3
3
15
Input
4
5
2 4 8 16 32
7
2 4 8 16 32 64 128
8
2 4 12 8 16 32 64 128
8
1 2 4 8 16 32 64 127
Output
60
252
254
127