# -*- coding: utf-8 -*-
# Leonardo Deliyannis Constantin
# URI 2381 - Lista de Chamada

import sys

for line in sys.stdin:
    N = int(line.split()[0])
    k = int(line.split()[1])
    v = []
    for i in range(0, N):
    	v.append(input())
    v.sort()
    print(v[k-1])

480812da93ad1ba7b1652881daa22d08ffa73599
<mask token>

<mask token>
for line in sys.stdin:
    N = int(line.split()[0])
    k = int(line.split()[1])
    v = []
    for i in range(0, N):
        v.append(input())
    v.sort()
    print(v[k - 1])

import sys
for line in sys.stdin:
    N = int(line.split()[0])
    k = int(line.split()[1])
    v = []
    for i in range(0, N):
        v.append(input())
    v.sort()
    print(v[k - 1])

# -*- coding: utf-8 -*-
# Leonardo Deliyannis Constantin
# URI 2381 - Lista de Chamada

import sys

for line in sys.stdin:
    N = int(line.split()[0])
    k = int(line.split()[1])
    v = []
    for i in range(0, N):
    	v.append(input())
    v.sort()
    print(v[k-1])
