import itertools

N = int(input())
A = tuple(map(int, input().split()))

ans = max(p ^ q for p, q in itertools.combinations(A, 2))
print(ans)