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

8a2a27f53ab1c069aa6c63109d24d12c36efbbf8
<mask token>

<mask token>
for i in range(N - 1):
    for j in range(i + 1, N):
        result = max(result, A[i] ^ A[j])
print(result)

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