import java.util.*;

public class MyStack extends Stack

{

/**

* Returns element at the top of the stack without popping it.

* @exception EmptyStackException If the stack is empty.

*/

public Point Top()

{

int len = size();

if (len == 0)

throw new EmptyStackException();

return (Point) elementAt(len - 1);

}

/**

* Returns element next to the top of the stack without popping it.

* @exception EmptyStackException If the stack is empty.

*/

public Point Next_To_Top()

{

int len = size();

if (len == 0)

throw new EmptyStackException();

return (Point) elementAt(len - 2);

}

}