#include<stdio.h>
int main()
{
int n = 0, k = 0, num = 0, xue[200],i=0;
float grade [200] ;
scanf_s("%d %d", &n, &k);
printf("\n");
for (num = 0; num < n; num++)
{
scanf_s("%d %f",&xue[num], &grade[num]);
}
for (i = 0; i <= n; i++)
{
num = 0;
for (num = 0; num < n; num++)
{
if (grade[num] < grade[num + 1])
{
float tmp = grade[num];
grade[num] = grade[num + 1];
grade[num + 1] = tmp;
float tem = xue[num];
xue[num] = xue[num + 1];
xue[num+1] = tem;
}
}
}
printf("%d %g",xue[k-1], grade[k - 1]);
return 0;
}