#include<cstdio>
int main()
{
int N;
scanf("%d",&N);
long long A[101010];
for(int i=0;i<N;i++)
scanf("%lld",A+i);
long long ans=0;
int cnt=0;
for(int j=62;j>=0;j--)
{
for(int i=cnt;i<N;i++)
{
if( A[i] & (1LL<<j) )
{
long long t=A[i];
A[i]=A[cnt];
A[cnt]=t;
for(int k=0;k<N;k++)
if(cnt!=k && (A[k] & (1LL<<j) ) )
A[k]^=A[cnt];
cnt++;
break;
}
}
}
for(int i=0;i<cnt;i++) ans^=A[i];
printf("%lld",ans);
}
I2luY2x1ZGU8Y3N0ZGlvPgppbnQgbWFpbigpCnsKCWludCBOOwoJc2NhbmYoIiVkIiwmTik7Cglsb25nIGxvbmcgQVsxMDEwMTBdOwoJZm9yKGludCBpPTA7aTxOO2krKykKCQlzY2FuZigiJWxsZCIsQStpKTsKCWxvbmcgbG9uZyBhbnM9MDsKCWludCBjbnQ9MDsKCWZvcihpbnQgaj02MjtqPj0wO2otLSkKCXsKCQlmb3IoaW50IGk9Y250O2k8TjtpKyspCgkJewoJCQlpZiggQVtpXSAmICgxTEw8PGopICkKCQkJewoJCQkJbG9uZyBsb25nIHQ9QVtpXTsKCQkJCUFbaV09QVtjbnRdOwoJCQkJQVtjbnRdPXQ7CgkJCQlmb3IoaW50IGs9MDtrPE47aysrKQoJCQkJCWlmKGNudCE9ayAmJiAoQVtrXSAmICgxTEw8PGopICkgKQoJCQkJCQlBW2tdXj1BW2NudF07CgkJCQljbnQrKzsKCQkJCWJyZWFrOwoJCQl9CgkJfQoJfQoJZm9yKGludCBpPTA7aTxjbnQ7aSsrKSAgYW5zXj1BW2ldOwoJcHJpbnRmKCIlbGxkIixhbnMpOwp9