#D1757. Sorting Pairs
Sorting Pairs
Sorting Pairs
Write a program which print coordinates of given points on the plane by the following criteria.
- first by -coordinate
- in case of a tie, by -coordinate
Constraints
Input
The input is given in the following format.
:
In the first line, the number of points is given. In the following lines, coordinates of each point are given.
Output
Print coordinate of given points in order.
Example
Input
5 4 7 5 5 2 3 6 8 2 1
Output
2 1 2 3 4 7 5 5 6 8
inputFormat
Input
The input is given in the following format.
:
In the first line, the number of points is given. In the following lines, coordinates of each point are given.
outputFormat
Output
Print coordinate of given points in order.
Example
Input
5 4 7 5 5 2 3 6 8 2 1
Output
2 1 2 3 4 7 5 5 6 8
样例
5
4 7
5 5
2 3
6 8
2 1
2 1
2 3
4 7
5 5
6 8
</p>