Sorting Points by Coordinates

Sort N planar points by increasing x coordinate, breaking ties by increasing y, and print them in order.

Easy3SortingInterviewNo attempts yetTime limit1sMemory limit256 MB

Problem

You are given NN points on a two-dimensional plane. Write a program that sorts the points by increasing xx coordinate, and by increasing yy coordinate when the xx coordinates are equal, then prints them.

Input

The first line contains the number of points NN (1N100,0001 \le N \le 100{,}000). Each of the next NN lines contains the coordinates xix_i and yiy_i of the ii-th point, separated by a space (100,000xi,yi100,000-100{,}000 \le x_i, y_i \le 100{,}000). All coordinates are integers, and no two points share the same position.

Output

Print the sorted points on NN lines, one point per line. On each line print the xx coordinate and the yy coordinate separated by a space.