eval(input())

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

print((sum(l[::2])-sum(l[1::2])))
eval(input())

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

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

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

-l = sorted(map(int, input().split()))[::-1] -print((sum(l[::2]) - sum(l[1::2]))) +a = sorted(map(int, input().split()))[::-1] +print((sum(a[::2]) - sum(a[1::2])))