n=int(eval(input()))

a=list([int(x) for x in input().split()])

a.sort(reverse=True)

print((sum(a[1:2*n:2])))
n=int(eval(input()))

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

a.sort(reverse=True)

print((sum(a[1:2*n:2])))
n = int(eval(input()))
a = list([int(x) for x in input().split()])
a.sort(reverse=True)
print((sum(a[1 : 2 * n : 2])))

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

-a = list([int(x) for x in input().split()]) +a = list(map(int, input().split()))