#P1847C. Vampiric Powers, anyone?

Vampiric Powers, anyone?

Description

DIO knows that the Stardust Crusaders have determined his location and will be coming to fight him. To foil their plans he decides to send out some Stand users to fight them. Initially, he summoned nn Stand users with him, the ii-th one having a strength of aia_i. Using his vampiric powers, he can do the following as many times as he wishes:

  • Let the current number of Stand users be mm.
  • DIO chooses an index ii (1im1 \le i \le m).
  • Then he summons a new Stand user, with index m+1m+1 and strength given by: am+1=aiai+1am,a_{m+1} = a_i \oplus a_{i+1} \oplus \ldots \oplus a_m,

    where the operator \oplus denotes the bitwise XOR operation.

  • Now, the number of Stand users becomes m+1m+1.

Unfortunately for DIO, by using Hermit Purple's divination powers, the Crusaders know that he is plotting this, and they also know the strengths of the original Stand users. Help the Crusaders find the maximum possible strength of a Stand user among all possible ways that DIO can summon.

Each test contains multiple test cases. The first line contains the number of test cases tt (1t100001 \le t \le 10\,000). The description of the test cases follows.

The first line of each test case contains a single integer nn (1n1051 \le n \le 10^5)  – the number of Stand users initially summoned.

The second line of each test case contains nn integers a1,a2,,ana_1, a_2, \ldots, a_n (0ai<280 \le a_i < 2^8)  – the strength of each Stand user.

It is guaranteed that the sum of nn over all test cases does not exceed 10510^5.

For each test case, output a single integer, maximum strength of a Stand user among all possible ways that DIO can summon.

Input

Each test contains multiple test cases. The first line contains the number of test cases tt (1t100001 \le t \le 10\,000). The description of the test cases follows.

The first line of each test case contains a single integer nn (1n1051 \le n \le 10^5)  – the number of Stand users initially summoned.

The second line of each test case contains nn integers a1,a2,,ana_1, a_2, \ldots, a_n (0ai<280 \le a_i < 2^8)  – the strength of each Stand user.

It is guaranteed that the sum of nn over all test cases does not exceed 10510^5.

Output

For each test case, output a single integer, maximum strength of a Stand user among all possible ways that DIO can summon.

样例输入 1

3
4
0 2 5 1
3
1 2 3
5
8 2 4 12 1

样例输出 1

7
3
14

Note

In the first test case, one of the ways to add new Stand users is as follows:

  • Choose i=ni=n. Now, aa becomes [0,2,5,1,1][0,2,5,1,1].
  • Choose i=1i=1. Now, aa becomes [0,2,5,1,1,7][0,2,5,1,1,7]. 77 is the maximum strength of a Stand user DIO can summon.

In the second test case, DIO does not need to add more Stand users because 33 is the maximum strength of a Stand user DIO can summon.