import java.util.*;
class JavaExampleStackOperation
{
public static void main(String args[])
{
Stack Stck = new Stack();
try
{
Stck.push(new Integer(0));
Stck.push(new Integer(1));
Stck.push(new Integer(2));
Stck.push(new Integer(3));
Stck.push(new Integer(4));
Stck.push(new Integer(5));
Stck.push(new Integer(6));
System.out.println((Integer) Stck.pop());
System.out.println((Integer) Stck.pop());
System.out.println((Integer) Stck.pop());
System.out.println((Integer) Stck.pop());
System.out.println((Integer) Stck.pop());
System.out.println((Integer) Stck.pop());
System.out.println((Integer) Stck.pop());
}
catch(EmptyStackException e1) {}
}
}