n = int(input())
argList = list(map(int, input().split()))
argList.sort()
argList.reverse()
a = 0
b = 0
for i in range(0, n):
    if i % 2 == 0:
        a += argList[i]
    else:
        b += argList[i]
print(a - b)

3dd4c13986d136bf216b9be6d298ba798cf3dbe5
<mask token>

<mask token>
argList.sort()
argList.reverse()
<mask token>
for i in range(0, n):
    if i % 2 == 0:
        a += argList[i]
    else:
        b += argList[i]
print(a - b)

n = int(input())
argList = list(map(int, input().split()))
argList.sort()
argList.reverse()
a = 0
b = 0
for i in range(0, n):
    if i % 2 == 0:
        a += argList[i]
    else:
        b += argList[i]
print(a - b)
