12564 - A lot of sandwiches (mid2)   

Description

Gordon Ramsay: What are you ?

A poor chef: An idiot sandwich.


You are Gordon Ramsay's chief advisor. He's going to judge a lot of sandwiches whether it is an idiot sandwich or not. However, recording the result is too tired for him, so he yells at you for help.


You are given n​ sandwiches. Gordon will tell you the label of each sandwich in the following formats:

  • Ramsay <lvl>: All sandwiches followed with this format are idiot sandwiches. And the number lvl is the level of the intelligence of the corresponding idiot sandwich.

  • <name>: All sandwiches with name not equals to "Ramsay" are masterpiece(in Gordon's opinion, it's a normal sandwich), and name is its name.

And you're asked to record each sandwich with the following formats:

  • For idiot sandwiches, record An idiot sandwich with intelligence level <lvl> only., where lvl is the intelligence level of the sandwich.

  • For normal sandwiches, record <name>. Masterpiece of sandwiches., where name is the name of the sandwich.

Note that this problem is special judge, you have to implement the functions that marked with TODO in function.h.

Input

The first line contains exactly one integer, indicates .

There are lines below. Each line contains one of the sandwich format.

.

for all level of idiot sandwiches.

for all names of normal sandwiches. All letters are 'a' - 'z' or 'A' - 'Z' without any space or newline.

Output

For each sandwich, output its record.

 

Sample Input  Download

Sample Output  Download

Partial Judge Code

12564.cpp

Partial Judge Header

12564.h

Tags




Discuss