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