# https://yukicoder.me/problems/no/1674 # No.1674 Introduction to XOR N = int(input()) A = list(map(int, input().split())) bits = 0 for a in A: bits |= a B = bin(bits) for i, b in enumerate(B[::-1]): if b in ("0, b"): print(1 << i) exit()