include[HTML_REMOVED]
using namespace std;
const int N=100010;
int a[N];
int n,k;
void quick_sort(int a[],int l,int r)
{
if (l>=r) return;
int x=a[l],i=l-1,j=r+1;
while (i<j)
{
do i++;while(a[i]<x);
do j--;while(a[j]>x);
if (i<j) swap(a[i],a[j]);
}
quick_sort(a,l,j);
quick_sort(a,j+1,r);
}
int main()
{
scanf(“%d%d”,&n,&k);
for (int i=1;i<=n;++i) scanf("%d",&a[i]);
quick_sort(a,1,n);
printf("%d",a[k]);
return 0;
}