N = map(int, input().split())
A = set(map(int, input().split()))
B = set(map(int, input().split()))
ans = []
for n in A:
if n not in B:
ans.append(n)
ans.sort()
print(len(ans))
if len(ans) != 0:
print(*ans)
N = map(int, input().split())
A = set(map(int, input().split()))
B = set(map(int, input().split()))
ans = []
for n in A:
if n not in B:
ans.append(n)
ans.sort()
print(len(ans))
if len(ans) != 0:
print(*ans)