There were submissions made in a programming contest containing infinite problems. Each submission earned the contestant points as none of the submissions is a wrong or a partial submission. You are given the details of the submissions - the username of the contestant and the time taken to solve the problem. Your task is to print the rank list according to the following rules:
Note: The details of the submissions are not sorted in any order (neither by time nor by username)
INPUT FORMAT
The first line of every test file contains an integer , the number of submissions. lines follow, each being the details of th submission.
Each of the lines contains a string , the username of the contestant corresponding to submission, and an integer , the time of submission in minutes, separated by a space.
OUTPUT FORMAT
Output the rank of the contestant and the username, in the increasing order of the ranks. Each rank should be displayed in a newline.
CONSTRAINTS
where denotes the length of the string s
Number of unique usernames are at most
Tom stands 1st with 300 points since no other contestant scored 300. Jim stands 2nd as he has solved the problems in 29 minutes. Phil and Rick have scored 200 and solved the problems in 30 minutes. According to the third rule, Phil ranks 3rd.