N = int(eval(input()))

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

A.sort()

A.reverse()

a = 0

b = 0

for i in range(N):

  if i%2 == 0:

    a += A[i]

  else:

    b += A[i]

print((a-b))
N = int(eval(input()))

A = 0

B = 0

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

ls1.sort()

ls1.reverse()

for i in range(N):

    if i%2 == 0:

        A += ls1[i]

    else:

        B += ls1[i]

print((A-B))
N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
A.reverse()
a = 0
b = 0
for i in range(N):
    if i % 2 == 0:
        a += A[i]
    else:
        b += A[i]
print((a - b))

N = int(eval(input()))
A = 0
B = 0
ls1 = list(map(int, input().split()))
ls1.sort()
ls1.reverse()
for i in range(N):
    if i % 2 == 0:
        A += ls1[i]
    else:
        B += ls1[i]
print((A - B))

-A = list(map(int, input().split())) -A.sort() -A.reverse() -a = 0 -b = 0 +A = 0 +B = 0 +ls1 = list(map(int, input().split())) +ls1.sort() +ls1.reverse() -        a += A[i] +        A += ls1[i] -        b += A[i] -print((a - b)) +        B += ls1[i] +print((A - B))