N=int(eval(input()))

A=[int(i) for i in input().split()]

print((sum(A)-N))

print((-int(eval(input()))+sum(map(int,input().split()))))
N = int(eval(input()))
A = [int(i) for i in input().split()]
print((sum(A) - N))

print((-int(eval(input())) + sum(map(int, input().split()))))

-N = int(eval(input())) -A = [int(i) for i in input().split()] -print((sum(A) - N)) +print((-int(eval(input())) + sum(map(int, input().split()))))