Sort students by decreasing score; ties broken by ascending name. Print each student's name and score.
Input
First line $n$; then $n$ lines each with a (distinct) name and score ($1 \le n \le 1000$, $0 \le \text{score} \le 100$).
Output
Print the sorted name score lines.
Example 1
Input
5 zoe 90 amy 90 bob 100 cody 80 mike 90
Output
bob 100 amy 90 mike 90 zoe 90 cody 80
Discussion
Threads about this problem. Spoilers are collapsed; wrap hints in
||double bars||.No discussion yet. Start a thread if something here needs explaining.