1 #include<stdio.h>
2 #include<string.h>
3 int main()
4 {
5 char command[5],color[1000];
6 int i=0;
7 while(1){
8 scanf("%s",command);
9 if(strcmp(command,"push")==0){
10 getchar();
11 color[i++]=getchar();
12 }else if(strcmp(command,"pop")==0){
13 printf("%c\n",color[--i]);
14 }else if(strcmp(command,"quit")==0){
15 return(0);
16 }
17 }
18 }