N=int(input()) A=list(map(int,input().split())) p=[x^y for x in A for y in A] print(max(p))