/**
 * Created by IntelliJ IDEA.
 * User: o_215
 * Date: 18.11.2009
 * Time: 17:14:26
 * To change this template use File | Settings | File Templates.
 */
import java.util.*;
import java.io.*;

class A {
    static class Point implements Comparable<Point> {
        int x; int y;
        public Point(int _x,int _y){x=_x;y=_y;}
        public int compareTo(Point p) {
            return (x-p.x!=0)?x-p.x:y-p.y;
        }
    }
    public static void main(String[] args) throws Exception{
        Scanner in=new Scanner(new File("points.in"));
        PrintWriter out=new PrintWriter(new File("points.out"));
        Point[] p=new Point[100000];    
        int i=0;
        while (in.hasNext()){
            p[i]=new Point(in.nextInt(),in.nextInt());
            i++;
        }
        Arrays.sort(p,0,i);
        for(int j=0;j<i;j++){
            out.println(p[j].x+ " " + p[j].y);
        }
        in.close();
        out.close();
    }

}
