import numpy as np



n=int(eval(input()))

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

a_list_2=sorted(a_list,reverse=True)

a=np.array(a_list_2,dtype='uint8')



alice=0

bob=0

for i in range(n):

	if i%2==0:

		alice+=a[i]

	else:

		bob+=a[i]



print((alice-bob))

n=int(eval(input()))

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

a.sort(reverse=True)



alice=0

bob=0



for i in range(n):

    if i%2==0:

        alice+=a[i]

    else:

        bob+=a[i]

        

print((alice-bob))
import numpy as np

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

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

-import numpy as np - -a_list = list(map(int, input().split())) -a_list_2 = sorted(a_list, reverse=True) -a = np.array(a_list_2, dtype="uint8") +a = list(map(int, input().split())) +a.sort(reverse=True)