https://www.luogu.com.cn/problem/P3378
#include<bits/stdc++.h>
using namespace std;
priority_queue<int,vector<int>,greater<int>>heap;
int main(void)
{
int n; cin>>n;
while(n--)
{
int op; cin>>op;
if(op==1)
{
int x; cin>>x;
heap.push(x);
}else if(op==2) cout<<heap.top()<<endl;
else heap.pop();
}
return 0;
}