Сделал все что мог придумать 
	
	
	
		
			
			
		Python:
	
	a = input()
b = input()
a = [int(i) for i in a.split()]
b = [int(i) for i in b.split()]
t = True
while t:
    t = False
    for j in range(a[0] - 1):
        if b[j] < b[j + 1]:
            b[j], b[j + 1] = b[j + 1], b[j]
            t = True
    a[0] -= 1
print(b[a[1]-1])