{priority_queuea,b;ll@q,@k;rep(q){ll@t;if(t<2)if(a.push(rd_ll()),a.size()==k)b.push(-a.top()),a.pop();else wt(b.size()?(t=-b.top(),b.pop(),t):-1);}}