#yuki1082 n=int(input()) a=list(map(int,input().split())) res=0 for i in range(n): for j in range(i,n): res=max(res,a[i]^a[j]) print(res)