#include
#include
using namespace std;
int main()
{ //stack works on LIFO
stack st;
//three basic functions are
//push , pop , .empty
st.push(10);
for(int i=0;i<6;i++)
{
int a;
cin>>a;
st.push(a);
}
while(!st.empty())
{
cout<<st.top()<<" ";//dispalys the top most element of stack
st.pop();
}
}