#include <iostream>
#include <queue>
using namespace std;
int main() {
priority_queue<int> pq;
// Pushing elements
pq.push(40);
pq.push(10);
pq.push(30);
pq.push(20);
while (!pq.empty()) {
cout << pq.top() <<endl;
pq.pop();
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8cXVldWU+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKICAgIHByaW9yaXR5X3F1ZXVlPGludD4gcHE7CgogICAgLy8gUHVzaGluZyBlbGVtZW50cwogICAgcHEucHVzaCg0MCk7CiAgICBwcS5wdXNoKDEwKTsKICAgIHBxLnB1c2goMzApOwogICAgcHEucHVzaCgyMCk7CiAgICAKICAgICB3aGlsZSAoIXBxLmVtcHR5KCkpIHsKICAgICAgICBjb3V0IDw8IHBxLnRvcCgpIDw8ZW5kbDsKICAgICAgICBwcS5wb3AoKTsKICAgIH0KICAgIHJldHVybiAwOwp9