n=int(eval(input()))

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

ans=0

for i in range(n):

  if i%2==0:

    ans+=a[i]

  else:

    ans-=a[i]

print(ans)
N=eval(input())

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

alice=0

bob=0

a=sorted(a,reverse=True)

for i in range(int(N)):

    if i%2==0:

        alice+=a[i]

    else:

        bob+=a[i]

print((alice-bob))
n = int(eval(input()))
a = sorted(list(map(int, input().split())), reverse=True)
ans = 0
for i in range(n):
    if i % 2 == 0:
        ans += a[i]
    else:
        ans -= a[i]
print(ans)

N = eval(input())
a = list(map(int, input().split()))
alice = 0
bob = 0
a = sorted(a, reverse=True)
for i in range(int(N)):
    if i % 2 == 0:
        alice += a[i]
    else:
        bob += a[i]
print((alice - bob))

-n = int(eval(input())) -a = sorted(list(map(int, input().split())), reverse=True) -ans = 0 -for i in range(n): +N = eval(input()) +a = list(map(int, input().split())) +alice = 0 +bob = 0 +a = sorted(a, reverse=True) +for i in range(int(N)): -        ans += a[i] +        alice += a[i] -        ans -= a[i] -print(ans) +        bob += a[i] +print((alice - bob))