XOR

아직 제출이 없습니다시간 제한6초메모리 제한512 MB

문제

Every good problemset needs a problem that can be summarized in a single doge meme. Today's problemset is no different.

Given a multiset SS of non-negative integers, divide it into two multisets AA and BB in a way that minimizes xor(A)xor(B)|\text{xor}(A) - \text{xor}(B)|. Here xor(X)\text{xor}(X) denotes the bitwise XOR of all elements of XX.

Note that one of the multisets AA and BB can be empty, and XOR of an empty multiset is 00

It is enough to output the minimum possible value of xor(A)xor(B)|\text{xor}(A) - \text{xor}(B)|.

입력

The first line of input contains the number of test cases zz (1z501 \leq z \leq 50). The descriptions of the test cases follow, two lines per test case.

The first line of every test case contains an integer nn (1n1051 \leq n \leq 10^5) -- the size of the multiset.

The second line contains nn integers x_ix\_i (0x_i10180 \leq x\_i \leq 10^{18}) -- elements of the multiset.

출력

For each test case output one integer: the smallest possible difference of XORs.