/*H E A D*/
struct Trie{
int son[maxn<<2][2];
int b[67],tot;
void init(){
// memset(son,0,sizeof son);
tot=0;
son[0][0]=son[0][1]=0;
}
void insert(ll x){
int now=0;
rep(i,0,32) b[i]=(x>>i)&1;
rrep(i,32,0){
if(!son[now][b[i]]){
son[now][b[i]]=++tot;
son[tot][0]=son[tot][1]=0;
}
now=son[now][b[i]];
}
}
ll find(ll x){
int now=0;
ll ans=0;
rep(i,0,32) b[i]=(x>>i)&1;
rrep(i,32,0){
if(son[now][b[i]^1]){
now=son[now][b[i]^1];
ans+=1ll<<i;
}else{
now=son[now][b[i]];
}
}
return ans;
}
}trie;
ll a[maxn];
int main(){
int T=read();
while(T--){
int n=read();
rep(i,1,n) a[i]=read();
rep(i,2,n) a[i]^=a[i-1];
trie.init();
rep(i,1,n) trie.insert(a[i]);
ll ans=-oo;
rep(i,0,n) ans=max(ans,trie.find(a[i]));//0->n
println(ans);
}
return 0;
}