安徽科技工程大学程序设计在线考试系统Ver3.0

诚信考试,杜绝作弊!

问题 M: Permutation - Sorting Pairs

内存限制:512 MB 时间限制:1 S 标准输入输出
题目类型:传统 评测方式:文本比较

题目描述

Sorting Pairs Write a program which print coordinates (xi,yi) of given n points on the plane by the following criteria.

 first by x-coordinate in case of a tie, by y-coordinate

输入格式

The input is given in the following format. 

n

x0 y0 

x1 y1

 : 

xn−1 yn−1

 In the first line, the number of points n is given. In the following n lines, coordinates of each point are given.

输出格式

Print coordinate of given points in order.

输入样例 复制

5
4 7
5 5
2 3
6 8
2 1

输出样例 复制

2 1
2 3
4 7
5 5
6 8

数据范围与提示

1≤n≤100,000

 −1,000,000,000≤xi,yi≤1,000,000,000