N = int(input())
A = input().split()
B = input().split()

L = {}
for i in range(len(A)):
    for j in range(len(B)):
        c = int(A[i]) + int(B[j])
        if c in L:
            del L[c] 
        else:
            L[c] = c
a = 0
for i in L.values():
    a = a ^ i
print(a)