#include <iostream>
#include<stack>
using namespace std;
int main() 
{
    stack<int>v;
    int a;
    while(cin>>a)
    {
        v.push(a);
    }
    v.pop();
    while(!v.empty())
    {
        cout<<v.top()<<" ";
        v.pop();
    }
    return 0;
}