N = int(eval(input()))

A = list([int(x) - 1 for x in input().split()])



print((sum(A)))

N = int(eval(input()))

A = list(map(int, input().split()))

ans = sum(A) - N

print(ans)

N = int(eval(input()))
A = list([int(x) - 1 for x in input().split()])
print((sum(A)))

N = int(eval(input()))
A = list(map(int, input().split()))
ans = sum(A) - N
print(ans)

-A = list([int(x) - 1 for x in input().split()]) -print((sum(A))) +A = list(map(int, input().split())) +ans = sum(A) - N +print(ans)