from itertools import combinations input() print(max(a^b for a,b in combinations(tuple(map(int,input().split())),2)))