#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;
struct stu{
char num[100];
double a;
};
int main()
{
int n,k,i,j;
stu student[100],t;
cin >> n >> k;
for (i = 1; i <=n; i++)
cin >> student[i].num >> student[i].a;
for(i=1;i<=n-1;i++)
for(j=1;j<=n-i;j++)
if (student[j].a < student[j+1].a)
{
t = student[j];
student[j]=student[j+1];
student[j+1]= t;
}
cout << student[k].num << " " << student[k].a << endl;
return 0;
}