import numpy as np



N = int(eval(input()))

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



a.sort()

a = a[::-1]



print((a[0::2].sum() - a[1::2].sum()))
n = int(eval(input()))

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



arr.sort(reverse=True)



print((sum(arr[0::2]) - sum(arr[1::2])))
import numpy as np

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

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

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