from collections import Counter

n = int(input())
a = Counter(input().split()) + Counter(input().split())
print([e for e in a if a[e] % 2][0])

from collections import Counter

n = int(input())
a = Counter(input().split()) + Counter(input().split())
print([e for e in a if a[e] % 2][0])
