#include<bits/stdc++.h>
using namespace std;
int a,b,c,v[5000000],t[5000000];
int main(){
cin>>a>>b;
b=b*1.5;
for(int i=0;i<a;++i){cin>>v[i]>>t[i];}
for(int i=0;i<a-1;++i){
for(int j=0;j<a-i-1;++j){
if(t[j]<t[j+1]){swap(t[j],t[j+1]);swap(v[j],v[j+1]);}
}
}
for(int i=0;i<a-1;++i){
for(int j=0;j<a-i-1;++j){
if(t[j]==t[j+1]&&v[j]>v[j+1]){swap(t[j],t[j+1]);swap(v[j],v[j+1]);}
}
}
for(int i=0;i<a;++i){
if(t[i]>=t[b]) ++c;
}
printf("%d %d\n",t[b],c);
for(int i=0;i<a;++i){
if(t[i]>=t[b]) printf("%d %d\n",v[i],t[i]);
}
return 0;
}