n,*a=list(map(int,open(0).read().split()));print((sum(v for k,v in enumerate(sorted(a)[n:])if k%2<1)))
n,*a=list(map(int,open(0).read().split()));print((sum(sorted(a)[n:][::2])))
n, *a = list(map(int, open(0).read().split()))
print((sum(v for k, v in enumerate(sorted(a)[n:]) if k % 2 < 1)))

n, *a = list(map(int, open(0).read().split()))
print((sum(sorted(a)[n:][::2])))

-print((sum(v for k, v in enumerate(sorted(a)[n:]) if k % 2 < 1))) +print((sum(sorted(a)[n:][::2])))