#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;
}