#include iostream.h

#define max 30
class stack{
  private:
 char items[max];
 int top;
  public:
 stack(){top=-1;}
 int empty()
 {return  (top==-1?1:0);}
 int full()
 {return (top==(max-1)?1:0);}
 void push(char x)
 {
   if(full())
   {
   cout<<"stack is full";
   return;
   }
  items[++top]=x;
  return;
  }
  char pop()
 {
  if(empty())
  { cout<<"stack is empty";
  return 0;
  }
 return (items[top--]);
 }
 };
  main()
  {
 char y;
 stack s;
 cout<<"Enter your char:;\n";
 for(int a=0;a<10;a++)
 {
 cin>>y;

 s.push(y);
  }
  while(a>0)
  {
 cout< s.pop();

 a--;
   }
 return 0;
 }