/**
 * Created by IntelliJ IDEA.
 * User: m09cke
 * Date: 18.11.2009
 * Time: 17:07:50
 * To change this template use File | Settings | File Templates.
 */
import java.lang.*;
import java.io.*;
import java.util.Arrays;

public class Main implements Runnable{

    class Dot implements Comparable<Dot>{
        int x;
        int y;
        Dot(int a, int b){
            x = a;
            y = b;
        }
        public int getX(){
            return(x);
        }
        public int getY(){
            return(y);
        }
        public int compareTo(Dot a){
            if(x<a.x) return(-1);
            if(x==a.x&&y<a.y) return(-1);
            if(x==a.x&&y==a.y) return(0);
            return(1);
        }
    }

    public void run(){
        try{
            StreamTokenizer in = new StreamTokenizer(new BufferedInputStream(new FileInputStream(new File("points.in"))));
            PrintStream out = new PrintStream(new File("points.out"));
            Dot[] a = new Dot[100010];
            int n=0;
            while (in.ttype!=in.TT_EOF){
                in.nextToken();
                int x = (int)in.nval;
                in.nextToken();
                int y = (int)in.nval;
                a[n] = new Dot(x,y);
                n++;
            }
            n--;
            Dot[] b = new Dot[n];
            for (int i=0; i<n; i++){
                b[i] = a[i];
            }
            Arrays.sort(b);
            for (int i=0; i<n; i++){
                out.println(b[i].getX()+" "+b[i].getY());
            }
        }
        catch(Exception e){
            e.printStackTrace();
            System.exit(1);
        }
    }

    public static void main(String[] args){
        new Thread(new Main()).start();
    }

}
