n = int(eval(input()))

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

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

from itertools import product

max_total = 0

for lis in product((0, 1), repeat=n):

  total = 0

  for i, zero_one in enumerate(lis):

    total += (V[i]-C[i]) * zero_one

  max_total = max(max_total, total)

print(max_total)
n = int(eval(input()))

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

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

total = 0

for i in range(n):

  if V[i] - C[i] > 0:

    total += V[i] - C[i]

print(total)
n = int(eval(input()))
V = list(map(int, input().split()))
C = list(map(int, input().split()))
from itertools import product

max_total = 0
for lis in product((0, 1), repeat=n):
    total = 0
    for i, zero_one in enumerate(lis):
        total += (V[i] - C[i]) * zero_one
    max_total = max(max_total, total)
print(max_total)

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

-from itertools import product - -max_total = 0 -for lis in product((0, 1), repeat=n): -    total = 0 -    for i, zero_one in enumerate(lis): -        total += (V[i] - C[i]) * zero_one -    max_total = max(max_total, total) -print(max_total) +total = 0 +for i in range(n): +    if V[i] - C[i] > 0: +        total += V[i] - C[i] +print(total)