eval(input())

numbers = tuple(map(int, input().split(' ')))

print((sum([n - 1 for n in numbers])))

N = int(eval(input()))

print((sum(tuple(map(int, input().split(' ')))) - N))

eval(input())
numbers = tuple(map(int, input().split(" ")))
print((sum([n - 1 for n in numbers])))

N = int(eval(input()))
print((sum(tuple(map(int, input().split(" ")))) - N))

-eval(input()) -numbers = tuple(map(int, input().split(" "))) -print((sum([n - 1 for n in numbers]))) +N = int(eval(input())) +print((sum(tuple(map(int, input().split(" ")))) - N))