N = int(eval(input()))

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

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



D = [V[i] - C[i] for i in range(N)]

ans = 0

for i in range(N):

  if D[i] > 0: ans += D[i]



print(ans)
N = int(eval(input()))

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

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

 

ans = 0

for i in range(N):

  tmp = V[i] - C[i]

  if tmp > 0: ans += tmp



print(ans)
N = int(eval(input()))
V = list(map(int, input().split()))
C = list(map(int, input().split()))
D = [V[i] - C[i] for i in range(N)]
ans = 0
for i in range(N):
    if D[i] > 0:
        ans += D[i]
print(ans)

N = int(eval(input()))
V = list(map(int, input().split()))
C = list(map(int, input().split()))
ans = 0
for i in range(N):
    tmp = V[i] - C[i]
    if tmp > 0:
        ans += tmp
print(ans)

-D = [V[i] - C[i] for i in range(N)] -    if D[i] > 0: -        ans += D[i] +    tmp = V[i] - C[i] +    if tmp > 0: +        ans += tmp