import numpy as np

N = int(eval(input()))

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

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



N = int(eval(input()))

value = sorted(list(map(int,input().split())))[::-1]

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



import numpy as np

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

N = int(eval(input()))
value = sorted(list(map(int, input().split())))[::-1]
print((sum(value[::2]) - sum(value[1::2])))

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