#include<iostream>
#define ll long long
using namespace std;
const ll N=1e6+5;
ll n,b[N],a[N],ans;
//b[i]表示二进制下的第i位
void update(ll x){
for(ll i=60;i>=0;i--)
{
if(x >> i & 1 ){
if(b[i])x^=b[i];
else {
b[i] = x;
break;
}
}
}
}
int main(){
cin>>n;
for(ll i=1;i<=n;i++){cin>>a[i];update(a[i]);}
for(ll i=60;i>=0;i--)if((ans^(1ll<<i)) > ans)ans^=b[i];
cout<<ans<<endl;
return 0;
}