import numpy as np

N = int(eval(input()))

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

value=np.sort(value)[::-1]

#print(N,value)

a = np.sum(value[::2])

b = np.sum(value[1::2])

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

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

print((sum(a[::2]) - sum(a[1::2])))

import numpy as np

N = int(eval(input()))
value = list(map(int, input().split()))
value = np.sort(value)[::-1]
# print(N,value)
a = np.sum(value[::2])
b = np.sum(value[1::2])
print((a - b))

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

-import numpy as np - -N = int(eval(input())) -value = list(map(int, input().split())) -value = np.sort(value)[::-1] -# print(N,value) -a = np.sum(value[::2]) -b = np.sum(value[1::2]) -print((a - b)) +n = int(eval(input())) +a = sorted(list(map(int, input().split())), reverse=True) +print((sum(a[::2]) - sum(a[1::2])))