#include#include #include struct news{ int lev; int num; bool operator <(const news a)const{ return this->lev==a.lev?this->num>a.num:this->lev >n) { int cut=0; priority_queue q[4]; for(int i=0;i >str; if(str == "IN") { cut++; news so; int k; cin>>k>>so.lev; so.num=cut; q[k].push(so); } else if(str == "OUT") { int i; cin>>i; if(!q[i].empty()) { cout< <