12536 - People nowadays   

Description

You are going to maintain a data structure that each element is a person described by a string of name and int of age.

Give you n orders. There're four types of order

born:

The order will followed by a string and a int represented a person's name and age. Insert the new person into the set.

find:

The order will followed by a string and a int. Find out if the person exist in the set or not. If the person exist, print YES, else print NO.

kill

The order will followed by a string and a int. Erase the person from the set.

If you can't find the person, do nothing.

young:

Print the youngest person in the set. If multiple people has the same age, print the person whose name is the smallest lexicographical order.

If you can't find the person, do nothing.

Download the C++ reference.
You will see the file named "12534.cpp" but that's OK.
Just download the file and change the filename extension(副檔名) into "zip" then you can upzip the file and use the reference.
The link is below.

reference.zip

Input

The first line contains only one integer n(1 <= n <= 200000)

The following n lines each lines contains order as the description described.

Each name's length will not exceed 10000.

Each age is in rage of  int

Output

For each order print as demand.

Remember to print \n at the end of each output.

Sample Input  Download

Sample Output  Download

Tags




Discuss