Each line pairs an integer $x$ with a string $s$. Sort the pairs by increasing $x$ and print them in the same format.
Input
First line $n$; then $n$ lines each with a (distinct) integer $x$ and a string $s$ ($1 \le n \le 1000$).
Output
Print the pairs sorted by $x$, one per line.
Example 1
Input
3 30 cat 10 apple 20 banana
Output
10 apple 20 banana 30 cat
Discussion
Threads about this problem. Spoilers are collapsed; wrap hints in
||double bars||.No discussion yet. Start a thread if something here needs explaining.