Num = int(eval(input()))

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

Alice,Bob = 0,0



for i in range ( Num ):

    Check_Max = -1



    for x in range(len(Num_Array)):

        if Num_Array[x] > Check_Max :

            Check_Max = Num_Array[x]

            check = x



    Num_Array.pop(check)



    if i % 2 == 0 :

        Alice += Check_Max

    else:

        Bob += Check_Max



print((Alice - Bob))
Num = int(eval(input()))

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

Alice,Bob = 0,0



for i in range(Num):



    if i % 2 == 0 :

        Alice += Num_Array[i]

    else:

        Bob   += Num_Array[i]



print((Alice - Bob))
Num = int(eval(input()))
Num_Array = list(map(int, input().split()))
Alice, Bob = 0, 0
for i in range(Num):
    Check_Max = -1
    for x in range(len(Num_Array)):
        if Num_Array[x] > Check_Max:
            Check_Max = Num_Array[x]
            check = x
    Num_Array.pop(check)
    if i % 2 == 0:
        Alice += Check_Max
    else:
        Bob += Check_Max
print((Alice - Bob))

Num = int(eval(input()))
Num_Array = sorted(list(map(int, input().split())), reverse=True)
Alice, Bob = 0, 0
for i in range(Num):
    if i % 2 == 0:
        Alice += Num_Array[i]
    else:
        Bob += Num_Array[i]
print((Alice - Bob))

-Num_Array = list(map(int, input().split())) +Num_Array = sorted(list(map(int, input().split())), reverse=True) -    Check_Max = -1 -    for x in range(len(Num_Array)): -        if Num_Array[x] > Check_Max: -            Check_Max = Num_Array[x] -            check = x -    Num_Array.pop(check) -        Alice += Check_Max +        Alice += Num_Array[i] -        Bob += Check_Max +        Bob += Num_Array[i]