#include<bits/stdc++.h> using namespace std; struct qwq{ string a; int b; }s[100005]; bool cmp(qwq x,qwq y){ return x.b<y.b; } int main(){ int n,k; cin>>n>>k; for(int i=1;i<=n;++i) cin>>s[i].a>>s[i].b; sort(s+1,s+n+1,cmp); ...