n = int(eval(input()))

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

a.sort(reverse=True) # 降順

alice, bob = a[0::2], a[1::2]

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

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

a.sort(reverse=True)

ans = 0

for i,ai in enumerate(a):

    if i%2==0:

        ans += ai

    else:

        ans -= ai

print(ans)

n = int(eval(input()))
a = list(map(int, input().split()))
a.sort(reverse=True)  # 降順
alice, bob = a[0::2], a[1::2]
print((sum(alice) - sum(bob)))

N = int(eval(input()))
a = list(map(int, input().split()))
a.sort(reverse=True)
ans = 0
for i, ai in enumerate(a):
    if i % 2 == 0:
        ans += ai
    else:
        ans -= ai
print(ans)

-n = int(eval(input())) +N = int(eval(input())) -a.sort(reverse=True)  # 降順 -alice, bob = a[0::2], a[1::2] -print((sum(alice) - sum(bob))) +a.sort(reverse=True) +ans = 0 +for i, ai in enumerate(a): +    if i % 2 == 0: +        ans += ai +    else: +        ans -= ai +print(ans)