/**
 * 
 * @author Martin Lipinsky
 *
 */

public class intZasobnikSpoj {
	
	private class item {
		int key;
		item next;
		
		item (int key, item next) {
			this.key = key;
			this.next = next;
		}
	}
	
	item top;
	
	intZasobnikSpoj() {
		this.top = null;
	}
	
	public void push(int number) {
		top = new item(number,top);
	}
	
	public int pop() {
		int c = top.key;
		top = top.next;
		return c;
	}
	
	public boolean empty() {
		return (top == null);
	}
	
	public void println() {
		String S = "";
		if (empty()) {
			S = "Zasobnik je prazdny.";
		} else {
			item P = top;
			while (P != null) {
				S = P.key+S;
				P = P.next;
			}
		}
		System.out.println(S);
	}
}