LCC/Moose '18 Contest 3 J1 - Ninja Clashing

View as PDF

Submit solution

Points: 3
Time limit: 1.0s
Memory limit: 64M

Author:
Problem type

Ninjaclasher is a ninja fighting master, who has gained great fame and many Evan Zhang fan clubs from fighting ninjas who challenge him. Ninjaclasher is very powerful, with a power level of over 9000. His power level is 9001, to be exact. He is receiving applications from potential challengers, but he does not want to consider any applications from ninjas with a higher power level than his own.

Can you help Ninjaclasher make a list of all the applicants to ignore?

Input Specification

The first line of input will contain one integer, N (1 \le N \le 10^3), the number of challengers to follow.

The next N lines will each contain one string S (1 \le |S| \le 100), the name of the applicant, followed by one space and one integer P (1 \le P \le 10^5), their power level.

It is guaranteed that each name is one single word.

Output Specification

Print the names of all applicants, if any, with a power level greater than Ninjaclasher's in the same order from the input.

Sample Input

4
StirFry 42
Emacodo 9999
Menthol 6969
Evil 12345

Sample Output

Emacodo
Evil

Comments

There are no comments at the moment.