from collections import Counter N = int(input()) A = list(input().split()) B = list(input().split()) c1 = Counter(A) c2 = Counter(B) ans = 0 for k,v in c1.items(): if c2[k] == 0 or c2[k] != v: ans = k print(ans)