n = int(eval(input()))

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

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



max_z = 0

for i in range(2**n):

  #print("i:",i)

  x = 0

  y = 0

  for j in range(n):

    if i&(1<<j)!=0:

      #print('j:',j)

      x+=v[j]

      y+=c[j]

  z=x-y

  #print(z)

  max_z = max(max_z,z)

print(max_z)

  

n = int(eval(input()))

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

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



z=0

for i in range(n):

  if v[i]>c[i]:

    z+=v[i]-c[i]

print(z)

n = int(eval(input()))
v = list(map(int, input().split()))
c = list(map(int, input().split()))
max_z = 0
for i in range(2**n):
    # print("i:",i)
    x = 0
    y = 0
    for j in range(n):
        if i & (1 << j) != 0:
            # print('j:',j)
            x += v[j]
            y += c[j]
    z = x - y
    # print(z)
    max_z = max(max_z, z)
print(max_z)

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

-max_z = 0 -for i in range(2**n): -    # print("i:",i) -    x = 0 -    y = 0 -    for j in range(n): -        if i & (1 << j) != 0: -            # print('j:',j) -            x += v[j] -            y += c[j] -    z = x - y -    # print(z) -    max_z = max(max_z, z) -print(max_z) +z = 0 +for i in range(n): +    if v[i] > c[i]: +        z += v[i] - c[i] +print(z)