Snuke has N sticks. The length of the i-th stick is l_i.  Snuke is making a snake toy by joining K of the sticks together.  The length of the toy is represented by the sum of the individual sticks that compose it. Find the maximum possible length of the toy.
n , k = map(int,input().split())
lis = list(map(int,input().split()))
lis = sorted(lis)
ans = 0
for i in range(k):
  ans += lis[i]
print(ans)
n , k = map(int,input().split())
lis = list(map(int,input().split()))
lis = sorted(lis,reverse = True)
ans = 0
for i in range(k):
  ans += lis[i]
print(ans)