n = int(eval(input()))

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

c.sort(reverse=True)

a = sum([v for i, v in enumerate(c) if i % 2 == 0 ])

b = sum([v for i, v in enumerate(c) if i % 2 == 1 ])

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

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

A.sort(reverse=True)

ans = sum(A[::2]) - sum(A[1::2])

print(ans)
n = int(eval(input()))
c = list(map(int, input().split()))
c.sort(reverse=True)
a = sum([v for i, v in enumerate(c) if i % 2 == 0])
b = sum([v for i, v in enumerate(c) if i % 2 == 1])
print((a - b))

n = int(eval(input()))
A = list(map(int, input().split()))
A.sort(reverse=True)
ans = sum(A[::2]) - sum(A[1::2])
print(ans)

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