from collections import Counter N = int(input()) A = list(map(int,input().split())) B = list(map(int,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)