N = int(eval(input()))

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

a.sort()

ans = 0

for i in range(N, len(a), 2):

    ans += a[i]

print(ans)
N = int(eval(input()))

print((sum(sorted(map(int, input().split()))[N:3*N:2])))
N = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
ans = 0
for i in range(N, len(a), 2):
    ans += a[i]
print(ans)

N = int(eval(input()))
print((sum(sorted(map(int, input().split()))[N : 3 * N : 2])))

-a = list(map(int, input().split())) -a.sort() -ans = 0 -for i in range(N, len(a), 2): -    ans += a[i] -print(ans) +print((sum(sorted(map(int, input().split()))[N : 3 * N : 2])))