#include <bits/stdc++.h>
using namespace std;
struct trie
{
long long int val;
struct trie *left;
struct trie *right;
};
struct trie *root;
int maxsize = 32;
struct trie *initialise()
{
struct trie *node;
node = new trie();
node->val = -1;
node->left = NULL;
node->right = NULL;
return node;
};
void insert(long long int n)
{
struct trie *node;
node = root;
int i;
for(i = maxsize - 1; i >= 0; i--) {
if(n&(1 << i)) {
if(node->right == NULL) {
node->right = initialise();
}
node = node->right;
}
else {
if(node->left == NULL) {
node->left = initialise();
}
node = node->left;
}
}
node->val = n;
}
int query(long long int n)
{
int i;
struct trie *node;
node = root;
for(i = maxsize - 1; i >= 0; i--) {
if(n & (1 << i)) {
if(node->left != NULL) {
node = node->left;
}
else {
node = node->right;
}
}
else {
if(node->right != NULL) {
node = node->right;
}
else {
node = node->left;
}
}
}
return node->val;
}
int main()
{
long long int n;
long long int a[100005];
int i;
long long int y;
long long int x;
long long int t;
long long int max;
int count;
scanf("%lld",&t);
while(t--) {
root = initialise();
cin>>n;
max = 0;
count = 0;
for(i = 0; i < n; i++) {
cin>>a[i];
}
insert(0);
x = 0;
for(i = 0; i < n; i++) {
x = x ^ a[i];
insert(x);
y = query(x);
y = y ^ x;
if(y > max) {
max = y;
}
}
cout<<max<<endl;
}
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CnN0cnVjdCB0cmllCnsKICAgIGxvbmcgbG9uZyBpbnQgdmFsOwogICAgc3RydWN0IHRyaWUgKmxlZnQ7CiAgICBzdHJ1Y3QgdHJpZSAqcmlnaHQ7Cn07CnN0cnVjdCB0cmllICpyb290OwppbnQgbWF4c2l6ZSA9IDMyOwpzdHJ1Y3QgdHJpZSAqaW5pdGlhbGlzZSgpCnsKICAgIHN0cnVjdCB0cmllICpub2RlOwogICAgbm9kZSA9IG5ldyB0cmllKCk7CiAgICBub2RlLT52YWwgPSAtMTsKICAgIG5vZGUtPmxlZnQgPSBOVUxMOwogICAgbm9kZS0+cmlnaHQgPSBOVUxMOwogICAgcmV0dXJuIG5vZGU7Cn07CnZvaWQgaW5zZXJ0KGxvbmcgbG9uZyBpbnQgbikKewogICAgc3RydWN0IHRyaWUgKm5vZGU7CiAgICBub2RlID0gcm9vdDsKICAgIGludCBpOwoKICAgIGZvcihpID0gbWF4c2l6ZSAtIDE7IGkgPj0gMDsgaS0tKSB7CiAgICAgICAgaWYobiYoMSA8PCBpKSkgewogICAgICAgICAgICBpZihub2RlLT5yaWdodCA9PSBOVUxMKSB7CiAgICAgICAgICAgICAgICBub2RlLT5yaWdodCA9IGluaXRpYWxpc2UoKTsKICAgICAgICAgICAgfQogICAgICAgICAgICBub2RlID0gbm9kZS0+cmlnaHQ7CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICBpZihub2RlLT5sZWZ0ID09IE5VTEwpIHsKICAgICAgICAgICAgICAgIG5vZGUtPmxlZnQgPSBpbml0aWFsaXNlKCk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgbm9kZSA9IG5vZGUtPmxlZnQ7CiAgICAgICAgfQogICAgfQogICAgbm9kZS0+dmFsID0gbjsKfQppbnQgcXVlcnkobG9uZyBsb25nIGludCBuKQp7CiAgICBpbnQgaTsKICAgIHN0cnVjdCB0cmllICpub2RlOwogICAgbm9kZSA9IHJvb3Q7CgogICAgZm9yKGkgPSBtYXhzaXplIC0gMTsgaSA+PSAwOyBpLS0pIHsKICAgICAgICBpZihuICYgKDEgPDwgaSkpIHsKICAgICAgICAgICAgaWYobm9kZS0+bGVmdCAhPSBOVUxMKSB7CiAgICAgICAgICAgICAgICBub2RlID0gbm9kZS0+bGVmdDsKICAgICAgICAgICAgfQogICAgICAgICAgICBlbHNlIHsKICAgICAgICAgICAgICAgIG5vZGUgPSBub2RlLT5yaWdodDsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgaWYobm9kZS0+cmlnaHQgIT0gTlVMTCkgewogICAgICAgICAgICAgICAgbm9kZSA9IG5vZGUtPnJpZ2h0OwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgbm9kZSA9IG5vZGUtPmxlZnQ7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9CgogICAgcmV0dXJuIG5vZGUtPnZhbDsKfQoKCgppbnQgbWFpbigpCnsKICAgIGxvbmcgbG9uZyBpbnQgbjsKICAgIGxvbmcgbG9uZyBpbnQgYVsxMDAwMDVdOwogICAgaW50IGk7CiAgICBsb25nIGxvbmcgaW50IHk7CiAgICBsb25nIGxvbmcgaW50IHg7CiAgICBsb25nIGxvbmcgaW50IHQ7CiAgICBsb25nIGxvbmcgaW50IG1heDsKICAgIGludCBjb3VudDsKICAgIAogICAgCiAgICBzY2FuZigiJWxsZCIsJnQpOwogICAgd2hpbGUodC0tKSB7CiAgICAgICAgcm9vdCA9IGluaXRpYWxpc2UoKTsKICAgIGNpbj4+bjsKICAgIG1heCA9IDA7CiAgICBjb3VudCA9IDA7CiAgICBmb3IoaSA9IDA7IGkgPCBuOyBpKyspIHsKICAgICAgICBjaW4+PmFbaV07CiAgICAgICAgCiAgICB9CgogICAgCiAgIAogICAgaW5zZXJ0KDApOwogCiAgICB4ID0gMDsKCiAgICBmb3IoaSA9IDA7IGkgPCBuOyBpKyspIHsKICAgICAgICB4ID0geCBeIGFbaV07CiAgICAgICAgaW5zZXJ0KHgpOwogICAgICAgIHkgPSBxdWVyeSh4KTsKICAgICAgICB5ID0geSBeIHg7CiAgICAgICAgaWYoeSA+IG1heCkgewogICAgICAgICAgICBtYXggPSB5OwogICAgICAgIH0KICAgIH0KICAgIGNvdXQ8PG1heDw8ZW5kbDsKICAgIH0KCgp9Cg==