Problem list
Log in
#r03354 · Online Judge > GoldOJ

Sort by Integer Key

Bronze I 2.0 s 1024 MB

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
Source
Online Judge > GoldOJ
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code