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

public class governor_vv{

  public class point implements Comparable<point>{
    double x;
    int z;

    point(double a, double b, int n){
      x = (a-1)/b;
      z = n;
    }

    public int compareTo(point q){
      if (x>q.x) return -1;
      if (x<q.x) return 1;
      return 0;
    }
  }
  
  Scanner in;
  PrintWriter out;

  String FILE_NAME = "governor";


  public void run() throws Exception{
    Locale.setDefault(Locale.US);
    in = new Scanner(new File(FILE_NAME+".in"));
    out = new PrintWriter(new BufferedWriter(new FileWriter(new File(FILE_NAME+".out"))));
    int n = in.nextInt();
    int k = in.nextInt();
    point[] p = new point[n];
    for(int i=0;i<n;i++){
      p[i] = new point(in.nextDouble(),in.nextDouble(),i+1);
    }
    Arrays.sort(p);
    for(int i=0;i<n;i++)
      out.println(p[i].z);
  }



  public void close(){
    out.close();
  }
  public static void main(String[] args) throws Exception{
    governor_vv a= new governor_vv();
    a.run();
    a.close();
  }

}
