/*
#include <stdio.h>
int queue[401]={};
int front=0;
int back=0;
void push(int data){
back++;
queue[back]=data;
}
int pop(){
if(front!=back){front++;return queue[front];};
}
main(){
int n;
char arr[401]={};
scanf("%d\n",&n);
for(int i=1;i<=n;i++){
gets(arr);
if(arr[0]=='b'){
if(back==front){
printf("-1\n");
}
else{
printf("%d\n",queue[back]);
}
}
else if(arr[1]=='u'){
int a=0;
for(int j=6;arr[j]!=' ';j++){
a=a*10+arr[j]-48;
}
push(a);
}
else if(arr[0]=='p'){
pop();
}
else if(arr[0] == 's'){
printf("%d\n", back-front);
}
else if(arr[0] == 'e'){
if(back == front){
printf("true\n");
}
else{
printf("false\n");
}
}
else if(arr[0] == 'f'){
if(front == back){
printf("-1\n");
}
else{
printf("%d\n",queue[front+1]);
}
}
}
}
*/
/*
#include<stdio.h>
int stack[201]={};int top=-1;void push(int data){top++;stack[top]=data;}int pop(){return stack[top--];}
int main() {
char a[101]={};
char b[101]={};
int olim=0;
scanf("%s %s",a,b);
int i=strlen(a)-1;
int j=strlen(b)-1;
for(;;) {
int x = a[i]-'0';
if(i<0) x=0;
int y = b[j]-'0';
if(j<0) y=0;
int num = (olim+x+y);
push(num%10);
olim=num/10;
if(i>=0)i--;
if(j>=0)j--;
if(i==-1 && j==-1)break;
}
if(olim!=0) {
push(olim);
}
while(top != -1) {
printf("%d",pop());
}
}
*/
#include<stdio.h>
int stack[201]={};
int top=-1;
void push(int data) {
top++;
stack[top]=data;
}
int pop() {
return stack[top--];
}
int main() {
char arr[201]={};
gets(arr);
for(int i=0 ; i<strlen(arr) ; i++) {
if() {
}
}
}