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

l=sorted(list(map(int,input().split())))

z=0

for i in range(a-b):

  z+=l[i]

print(z)
a,b=list(map(int,input().split()))

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

z=0

l=sorted(l)

for i in range(a-b):

  z+=l[i]

print(z)
a, b = list(map(int, input().split()))
l = sorted(list(map(int, input().split())))
z = 0
for i in range(a - b):
    z += l[i]
print(z)

a, b = list(map(int, input().split()))
l = list(map(int, input().split()))
z = 0
l = sorted(l)
for i in range(a - b):
    z += l[i]
print(z)

-l = sorted(list(map(int, input().split()))) +l = list(map(int, input().split())) +l = sorted(l)