Given $N$ points in the plane, sort them by increasing $x$; ties broken by increasing $y$. Print the sorted points.
Input
First line $N$; then $N$ lines each with $x_i$ and $y_i$ ($-100000 \le x_i, y_i \le 100000$). All positions are distinct.
Output
Print each point x y on its own line, in sorted order.
Example 1
Input
5 3 4 1 1 1 -1 2 2 3 3
Output
1 -1 1 1 2 2 3 3 3 4
Discussion
Threads about this problem. Spoilers are collapsed; wrap hints in
||double bars||.No discussion yet. Start a thread if something here needs explaining.