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