#t268. 成绩排序
成绩排序
Sorting Scores
Problem Background
Special for beginners, ^_^
Problem Description
Given a class transcript for one course, please sort and output it by score from highest to lowest. If scores are equal, the name that is lexicographically smaller comes first.
Input Format
The first line is , the number of students in the class.
The following lines each contain one student's name and score, separated by a single space. The name contains only letters and has length at most ; the score is a non-negative integer not exceeding .
Output Format
Sort the transcript by score from highest to lowest and output it. Each line contains the name and the score, separated by one space.
Sample Input
4
Kitty 80
Hanmeimei 90
Joey 92
Tim 28
Sample Output
Joey 92
Hanmeimei 90
Kitty 80
Tim 28
Constraints
1s, 1024KiB for each test case.