class MyStack {
			
	Node<T> theStack=null;
	
	boolean isEmpty(){
		return theStack==null;
	}
	
	T top() throws StackException{
		if(isEmpty()) throw new StackException("top-operation on empty Stack");
		else return theStack.content;
	}
	
	void pop() throws StackException{
		if(isEmpty()) throw new StackException("pop operation on empty stack");
		else theStack=theStack.next;
	}	
	
	void push(T elt){
		Node<T> nd = new Node(elt,theStack);
		theStack=nd;
	}
	
	class Node {
		T 		content;
		Node<T> next;
		
		Node(T content, Node<T> next){
			this.content=content;
			this.next=next;
		}	
		
	}
		
	
}