N=int(input()) A=list(map(int,input().split())) ANS=0 for i in range(N): for j in range(i,N): ANS=max(ANS,A[i]^A[j]) print(ANS)