N = int(eval(input()))

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

src.sort(reverse=True)

a = sum(src[::2])

b = sum(src[1::2])

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

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

A.sort()



ali = bob = 0

for i,a in enumerate(reversed(A)):

    if i%2:

        bob += a

    else:

        ali += a

print((ali - bob))
N = int(eval(input()))
src = list(map(int, input().split()))
src.sort(reverse=True)
a = sum(src[::2])
b = sum(src[1::2])
print((a - b))

N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
ali = bob = 0
for i, a in enumerate(reversed(A)):
    if i % 2:
        bob += a
    else:
        ali += a
print((ali - bob))

-src = list(map(int, input().split())) -src.sort(reverse=True) -a = sum(src[::2]) -b = sum(src[1::2]) -print((a - b)) +A = list(map(int, input().split())) +A.sort() +ali = bob = 0 +for i, a in enumerate(reversed(A)): +    if i % 2: +        bob += a +    else: +        ali += a +print((ali - bob))