#include <iostream>
#include <stack>
#include <queue>
#include <stdlib.h>
#include <time.h>


using namespace std;

// Adapt the header of the function to your case
queue<int> stack_to_queue(stack<int> s);

void llegeix(stack<int> &s)
{
    
    for (int i = 0; i < 10 ; ++i) {
        int e;
        cin >> e;
        s.push(e);
    }
}

void escriu(queue<int> &q)
{
    int n = q.size();
    for (int i = 0; i < n; ++i) {
        cout << q.front() << " ";
        q.pop();
    }
    cout << endl;
}

// Adapt the call to 'function_name' and the way it is called to your case.
int main(){
    stack<int> s;
    queue<int> q;
    
    llegeix(s);
    q = stack_to_queue(s);
    escriu(q);   
}

    


 


 
