import java.util.Scanner;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Collections;
import java.io.File;
import java.io.PrintWriter;

/**
 * Created by IntelliJ IDEA.
 * User: m09fpv
 * Date: 18.11.2009
 * Time: 17:29:19
 * To change this template use File | Settings | File Templates.
 */
public class points {
  static class Pair implements Comparable <Pair>{
       int a; int b;
       Pair(int x, int y){
       a=x; b=y;
                          }
      public int compareTo(Pair p){
       if (a!=p.a){ return a-p.a; }
       else { return b-p.b; }
      }
  }

  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 <Pair> p=new ArrayList <Pair>();
  int i=0;  int t;
   while(in.hasNextInt()){
    int a=in.nextInt();
    int b=in.nextInt();
    p.add(new Pair(a,b));
                        }
   Collections.sort(p);
   for(i=0;i<p.size();i++){
     out.println(p.get(i).a+" "+p.get(i).b);
   }
   in.close();
   out.close();
  }  
}
