eval(input());print((sum(sorted(map(int,input().split()))[::2])))
n,l=open(0);print((sum(sorted(map(int,l.split()))[::2])))
eval(input())
print((sum(sorted(map(int, input().split()))[::2])))

n, l = open(0)
print((sum(sorted(map(int, l.split()))[::2])))

-eval(input()) -print((sum(sorted(map(int, input().split()))[::2]))) +n, l = open(0) +print((sum(sorted(map(int, l.split()))[::2])))