#include<stdio.h>
#include<stdlib.h>
#include<time.h>
struct Stack {
int * Data;
int Top;
int Maxsize;
};
struct Stack* Creat(){
struct Stack*L;
L=(struct Stack*)malloc(sizeof(struct Stack));
L->Top=-1;
L->Maxsize=200;
L->Data=(int*)malloc(sizeof(int)*L->Maxsize);
return L;
}
int Pop(struct Stack*L){
if(L->Top==-1){
printf("Stack is empty\n");
}
return L->Data[L->Top--];
}
void Push(struct Stack*L,int x){
if(L->Top==L->Maxsize-1){
printf("Stack is Full\n");
return;
}
L->Data[++L->Top]=x;
}
int main(){
struct Stack *L;
L=Creat();
int i,k,t;
for(i=0;i<10;i++){
scanf("%d",&t);
Push(L,t);
}
for(i=0;i<10;i++){
k=Pop(L);
printf("%d ",k);
}
printf("\n");
return 0;
}