CodeLab Academy 📞 9936 6696
← List Python · Level 10: Algorithms Code · 100 points ← #918 #920 →

#919. Scoreboard

You get n lines `name score`. Sort by score from highest to lowest; if scores are equal, by name in alphabetical order. Print the names. ### Input n, then n lines. ### Output n lines.

Examples

Input
1
nomin 53
Output
nomin
Input
1
dorj 56
Output
dorj

💡 You can solve it with Python, JavaScript or blocks. Read the input line by line with input(). Don't print a question (like input("Number: ")). Print exactly what the output asks for, nothing more.

🔒 You can solve the first 3 problems without an account. Sign up for free to solve this one!