CodeLab Academy 📞 9936 6696
← List Python · Level 9: Functions and dicts Code · 90 points ← #857 #859 →

#858. Reverse a dictionary

You get n lines `key value` (all values are different). Swap them so the values become keys, and print `key value` in alphabetical order of the new keys. ### Input n, then n lines. ### Output n lines.

Examples

Input
3
c level
a kayak
d number
Output
kayak a
level c
number d
Input
3
e river
a mountain
d winter
Output
mountain a
river e
winter d

💡 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!