#include <iostream>
#include<ctype.h>
#include<cmath>
#include<iomanip>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;

int main()
{
    queue<int> q;
    q.push(10);
    q.push(20);
    q.push(30);
    q.push(40);
    while(!q.empty()) {
        cout << q.front() << endl;
        q.pop();
    }
    cout << q.empty() << endl;
    return 0;
}
