LearnPy Hub
← Dictionaries problems
Medium

Leaderboard

Read n lines of name points (n first). Print the names and points sorted by points high to low, ties by name.

Input

n, then n lines.

Output

n lines.

Sample 1

Input
3
Mim 30
Rafi 50
Sara 30
Output
Rafi 50
Mim 30
Sara 30

Sample 2

Input
1
A 0
Output
A 0
solution.py
Output appears here
Leaderboard · Python practice problem · LearnPy Hub