New operational system#9031

New operational system

1 second
128 megabytes
Very easy

Raphael has developed a new operating system. A new file can be created in it in two ways: by copying a previously created file and adding some number to it, or by copying a previously created file and deleting the last number from it. If the file being copied is empty and a delete operation is applied to it, then an empty file is created again.

At the very beginning, Raphael's operating system contains only one empty file, root. File root has number .

Raphael wants to create files one after another. The -th file can be created in one of two ways:

Input

The first line contains the number (1 < n \le 3 \cdot 10^5) of created files. The following lines contain the ways to create files: the -th line describes one of the two ways to create the -th file.

Output

Each time you create a new file, print the required result.

Examples

Example 65

Loading
Loading

Example 66

Loading
Loading