#include <stdio.h>
#include <string.h>
char k[100],a[100][100],aa,c[20][111] = {"push","top","pop","size","empty"},s='(';
int n,i,o,j,p,y=0,top=1,stack[100];
void play (int i, char aa)
{
switch (i)
{
case 0:
k=push(aa);
}
}
void push(char aa)
{
stack[top]=aa;
}
int main()
{
scanf("%d",&n);
for(i=0; i<n; i++)
{
gets(a[i]);
aa=a[7];
y=0;
for(o=0; o<5; o++)
{
if(y==0)
{
p=strcmp(a[i],c[o]);
if(p==0)
{
play(i,aa);
}
}
}
}
}