n=int(input()) arr=list(map(int,input().split())) ans=-1 for i in range(n): for j in range(i+1,n): ans=max(ans,arr[i]^arr[j]) print(ans)