Noir has gems. The -th gem has a positive integer written on it. Noir wants to divide these gems into several non-empty groups. Each gem belongs to exactly one group.
Suppose the -th group contains gems with label , then Noir treats the brightness of the -th group as , where is the bitwise-XOR operation. Denote the brightness of the -th group as .
For a grouping method of groups, Noir treats the value of this method as , where is the bitwise-AND operation.
Noir wants to find the maximum possible value over all grouping methods.
输入格式
The input contains multiple testcases. The first line of the input contains an integer (), the number of testcases.
For each testcase, the first line contains an integer (), the number of gems.
The second line contains integers (), the integers written on gems.
It’s guaranteed that the sum of over all testcases does not exceed .
输出格式
For each testcase, print an integer representing the maximum possible value over all grouping methods.
For the first testcase, a possible grouping method is with a value of . Another possible grouping method is , with a lower value . It can be proved that it’s not possible to achieve a value greater than .
For the second testcase, the best grouping method is with a value of .