_, prize_num = map(int, input().split())
scores = list(map(int, input().split()))
print(sorted(scores, reverse=True)[prize_num - 1])

a955a0b2de55d04673dcfeedaff98c535ff3a2c9
<mask token>

<mask token>
print(sorted(scores, reverse=True)[prize_num - 1])

_, prize_num = map(int, input().split())
scores = list(map(int, input().split()))
print(sorted(scores, reverse=True)[prize_num - 1])
