import java.util.Stack;


public class StackExample {
	public static void main(String[] args) {
		Stack<Integer> stack = new Stack<Integer>();
		
		stack.push(5);
		stack.push(3);
		stack.push(2);
		stack.push(7);
		
		while (!stack.empty()) {
			int next = stack.pop();
			System.out.println("Next number: " + next);
		}
	}
}

