#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
const int maxn=10000+10;
long long gay[maxn];//现行基(误)
inline void insert(long long x){
for(int i=62;i>=0;i--){
if(x&(1ll<<i)){
if(!gay[i]){
gay[i]=x;
break;
}
x^=gay[i];
}
}
}
inline long long get_max(){
long long ans=0;
for(int i=62;i>=0;i--)
if((ans^gay[i])>ans)
ans^=gay[i];
return ans;
}
int main(){
freopen("xor_equ.in","r",stdin);
freopen("xor_equ.out","w",stdout);
int n;
scanf("%d",&n);
long long x;
for(int i=1;i<=n;i++){
scanf("%lld",&x);
insert(x);
}
printf("%lld\n",get_max());
return 0;
}