I#include<bits/stdc++.h>
using namespace std;
int main() {
vector<pair<int,int> >v;
vector<pair<int,int> >:: iterator it;;
int q,k,t,x,y;
cin>>q>>k;
while(q–)
{ cin>>t;
if(t==1)
{
cin>>x>>y;
v.push_back(make_pair(x,y));
}
else if(t==2)
{sort(v.begin(),v.end());
it=v[k-1];
x=it->first;y=it->second;
cout<<x;
cout<<(xx+y*y);
}
}
return 0;
}