from collections import defaultdict as dd n = int(input()) alst = list(input().split()) blst = list(input().split()) cnt = dd(int) for b in blst: cnt[b] += 1 for a in alst: if cnt[a] == 0: print(a) break cnt[a] -= 1