num = int(eval(input()))

cards = sorted(list(map(int, input().split())), reverse = True)

alice = 0

bob = 0



for i in range(num):

  if i//2*2 == i:

    alice += cards[i]

  else:

    bob += cards[i]



print((alice - bob))
N = int(eval(input()))

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

A = sorted(A, reverse = True)

dif = sum(A[0::2]) - sum(A[1::2])

print(dif)
num = int(eval(input()))
cards = sorted(list(map(int, input().split())), reverse=True)
alice = 0
bob = 0
for i in range(num):
    if i // 2 * 2 == i:
        alice += cards[i]
    else:
        bob += cards[i]
print((alice - bob))

N = int(eval(input()))
A = list(map(int, input().split()))
A = sorted(A, reverse=True)
dif = sum(A[0::2]) - sum(A[1::2])
print(dif)

-num = int(eval(input())) -cards = sorted(list(map(int, input().split())), reverse=True) -alice = 0 -bob = 0 -for i in range(num): -    if i // 2 * 2 == i: -        alice += cards[i] -    else: -        bob += cards[i] -print((alice - bob)) +N = int(eval(input())) +A = list(map(int, input().split())) +A = sorted(A, reverse=True) +dif = sum(A[0::2]) - sum(A[1::2]) +print(dif)