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

public class Problem_A_18_11_09 {
    static class Point implements Comparable<Point>{
                 int x;
                 int y;
                 Point(int a, int b){
                     x = a;
                     y = b;
                 }
            public int compareTo(Point p){
                if (x!=p.x) {return x-p.x;}
                else {return 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"));
         ArrayList<Point> p = new ArrayList<Point>();
         while (in.hasNext()){
             int a = in.nextInt();
             int b = in.nextInt();
             p.add(new Point(a,b));
         }
        Collections.sort(p);
        for(int i = 0; i < p.size();i++){
            out.println(p.get(i).x+" "+p.get(i).y);
        }
        out.close();
        in.close();
      }

}
