import java.util.*;
import java.io.*;

class Points implements Runnable{
    class PointP implements Comparable<PointP> {
        int x, y;
        PointP(int x1, int x2){
            x = x1;
            y = x2;
        }
        public int compareTo(PointP  p){
           if(x < p.x)
              return -1;
           else if(x > p.x)
                   return 1;
           else{
              if(y < p.y)
                return -1;
              else if(y > p.y)
                     return 1;
                   else return 0;
           }
        }
    }
    public void run(){
       try{
           Scanner in = new Scanner(new File("points.in"));
           PrintWriter out = new PrintWriter(new File("points.out"));

           ArrayList<PointP> p = new ArrayList<PointP>();
           int n = 0;
           while(in.hasNextInt()) {
              p.add(new PointP(in.nextInt(),in.nextInt()));
              n++;
           }
           Collections.sort(p);
           for(int i = 0; i < n; i++){
               out.println(p.get(i).x + " " + p.get(i).y);
           }

           in.close();
           out.close();
       }  catch(Exception e){
            e.printStackTrace();
            System.exit(1);
          }
     }
     public static void main(String[] args) {
        new Thread(new Points()).start();
     }
}
