#include<iostream>
#include<algorithm>
#include<bits/stdc++.h>
using namespace std;
struct student {
int x,y;
}a[5005];
int main(){
int n,m;
cin>>n>>m;
int s[n];
for(int i=1;i<=n;i++) cin>>a[i].x>>a[i].y;
for(int i=1;i<=n;i++){
for(int j=1;j<i;j++){
if(a[i].y>a[j].y) swap(a[i],a[j]);
if(a[i].y==a[j].y){
if(a[i].x>a[j].x) ;
else swap(a[i],a[j]);
}
}
}
int t=ceil(m*3/2);//ceil 取整函数
//while循环做的事情是 如果你所选的分数线与多名选手相同 则应该让这些选手都进面试
while(1){
if(a[t].y==a[t+1].y) t++;
else break;
}
cout<<a[t].y<<" ";
cout<<t<<endl;
for(int i=1;i<=t;i++){
if(i!=t+1)
cout<<a[i].x<<" "<<a[i].y<<endl;
else cout<<a[i].x<<" "<<a[i].y;
}
return 0;
}
01-29
438
06-23
1003
03-04
2801