Problem Description

Input provides {x}. Start empty list. POP on empty does nothing. At end output size and last element (or EMPTY).

Input Format

First line q. Next q lines commands.

Output Format

One line result.

Sample Test Case

Input:
6 PUSH 5 PUSH 2 POP POP POP PUSH 9
Output:
1 9

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next