import java.io.*;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class Main implements Runnable{
    public class Point implements Comparable<Point>{
        int x;
        int y;
        Point(int xx, int yy){
            x = xx;
            y = yy;
        }
        public int compareTo(Point p){
            if(x > p.x) return 1;
            if(x < p.x) return -1;
            else{
                if(y > p.y) return 1;
                if(y < p.y) return -1;
            }
         return 0;
        }

    }
    public static void main(String[] args){
        new Thread (new Main()).start();
    }
    public void run(){
                try{
                    Point[] set = new Point[100001];
                    for(int i = 0;i < 100001; i++){
                        set[i] = new Point(Integer.MAX_VALUE,Integer.MAX_VALUE);
                    }
                    Scanner s = new Scanner(new File("points.in"));
                    PrintWriter p = new PrintWriter(new File("points.out"));
                    int i = 0;
                    while(s.hasNext()){
                        int a = s.nextInt();
                        int b = s.nextInt();
                        set[i++] = new Point(a,b);
                    }
                    Arrays.sort(set);
                    for(int j = 0; j < i; j++){
                        p.println(set[j].x + " "+ set[j].y);
                    }
                    p.close();

                } catch(Exception e){
                    e.printStackTrace();
                    System.exit(1);
                }
    }

}