N, = map(int, input().split()) X = list(map(int, input().split())) r = 0 for i in range(N): for j in range(i+1, N): r = max(r, X[i] ^ X[j]) print(r)