#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<algorithm>
#include<iostream>
#include<cmath>
#include<queue>
#include<vector>
using namespace std;
int u,v,m,n;
long long maxi=-599999;
long long a[1005];
long long b[1005][1005];
int main()
{
freopen("xor_equ.in","r",stdin);
freopen("xor_equ.out","w",stdout);
cin>>n;
for(int i=1;i<=n;i++)
cin>>a[i];
for(int i=1;i<n;i++)
for(int j=i+1;j<=n;j++)
{
b[i][j]=a[i] xor a[j];
if(b[i][j]>maxi)maxi=b[i][j];
}
cout<<maxi<<endl;
return 0;
}