Problem C. C----

Author:A. Klenin   Time limit:1 sec
Input file:input.txt   Memory limit:256 Mb
Output file:output.txt  

Statement

C---- language was designed specifically for students who failed standard course of Compiler Programming. C---- program is a list of statements. Each statement is one of:

Variable names are single small Latin letters. Constants are integers in range from 0 to 109. There are no spaces anywhere except after int and print keywords.

Each variable is declared at most once in the block, but variables with same name may be declared in different blocks. It that case, name refers to the variable declared in the nearest enclosing block. Note that variables may be defined in the middle of the block.

The program is guaranteed to be correct — all blocks are properly balanced, variables are referenced only after declaration, variables are always initialized before reading, etc. Program contains at least one print statement.

Your program must execute a given C---- program.

Input file format

First line of input file contains integer N. Following N lines contain one C---- statement each.

Output file format

Output file must contain a sequence of integers — one integer for each print statement.

Constraints

3 ≤ N ≤ 1000

Sample tests

No. Input file (input.txt) Output file (output.txt)
1
10
int a
int x
{
a=50
int a
a=60
x=a
print x
}
print a
60
50

0.067s 0.011s 13