2021-11-19 09:01:13 +00:00
|
|
|
#include <bits/stdc++.h>
|
2020-11-02 09:05:29 +00:00
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
priority_queue<int, vector<int>, greater<int> > q;
|
|
|
|
int n;
|
|
|
|
cin >> n;
|
2021-11-19 09:01:13 +00:00
|
|
|
while (n--) {
|
2020-11-02 09:05:29 +00:00
|
|
|
int op;
|
|
|
|
cin >> op;
|
2021-11-19 09:01:13 +00:00
|
|
|
if (op == 1) {
|
2020-11-02 09:05:29 +00:00
|
|
|
int x;
|
|
|
|
cin >> x;
|
|
|
|
q.push(x);
|
2021-11-19 09:01:13 +00:00
|
|
|
} else if (op == 2) {
|
2020-11-02 09:05:29 +00:00
|
|
|
cout << q.top() << endl;
|
2021-11-19 09:01:13 +00:00
|
|
|
} else if (op == 3) {
|
2020-11-02 09:05:29 +00:00
|
|
|
q.pop();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|