{$M 1638400,65536000}
const
  ZERO = 1e-8;

var
//  fi, fo:text;
  h: double;
  x, y, v, w: array [1..100] of double;

function dist(x1, y1, x2, y2: double): double;
begin
  dist := sqrt(sqr(x1 - x2) + sqr(y1 - y2));
end;

function square(x1, y1, x2, y2, x3, y3: double): double;
var
  p, a1, a2, a3: double;
begin
  a1 := dist(x1, y1, x2, y2);
  a2 := dist(x2, y2, x3, y3);
  a3 := dist(x3, y3, x1, y1);
  p := (a1 + a2 + a3) / 2;
  square := sqrt(p * (p - a1) * (p - a2) * (p - a3));
end;

function isinside(x1, y1, x2, y2, x3, y3, x4, y4, x, y: double): boolean;
var
  s, s1, s2, s3, s4: double;
begin
  s1 := square(x1, y1, x3, y3, x, y);
  s2 := square(x3, y3, x4, y4, x, y);
  s3 := square(x2, y2, x4, y4, x, y);
  s4 := square(x1, y1, x2, y2, x, y);
  s := dist(x1, y1, x2, y2) * dist(x1, y1, x3, y3);
  isinside := abs(s - (s1 + s2 + s3 + s4)) <= ZERO;
end;

function cross(x11, y11, x12, y12, x21, y21, x22, y22: double; ray1ln2: boolean): boolean;
var
  a11, a12, a13, a21, a22, a23: double;
  d, d1, d2, t1, t2: double;
begin
  a11 := x12 - x11; a12 := x21 - x22; a13 := x21 - x11;
  a21 := y12 - y11; a22 := y21 - y22; a23 := y21 - y11;
  d := a11 * a22 - a12 * a21;
  d1 := a13 * a22 - a12 * a23;
  d2 := a23 * a11 - a13 * a21;
  if abs(d) <= ZERO then begin
    if abs(d1) > ZERO then begin
      cross := false;
      exit;
    end;
    if abs(x11 - x12) > ZERO then cross := (x11 <= x22) and (x12 >= x21)
    else cross := (y11 <= y22) and (y12 >= y21);
  end else begin
    t1 := d1 / d;
    t2 := d2 / d;
    if ray1ln2 then
      cross := (t1 >= 0)
    else
      cross := (t1 >= 0) and (t1 <= 1) and (t2 >= 0) and (t2 <= 1);
  end;
end;

procedure calcx2y2(xx, yy, vv, ww: double; var xx1, yy1, xx2, yy2: double);
var
  t, t1: double;
  yl, xl: double;
begin
  xl := vv - xx;
  yl := ww - yy;
  if abs(xl) > ZERO then begin
    yy1 := sqrt(sqr(h) / (1 + sqr(yl / xl)));
    yy2 := -yy1;
    xx1 := - (yl / xl) * yy1;
    xx2 := - (yl / xl) * yy2;
  end
  else begin
    xx1 := sqrt(sqr(h) / (1 + sqr(xl / yl)));
    xx2 := -xx1;
    yy1 := - (xl / yl) * xx1;
    yy2 := - (xl / yl) * xx2;
  end;
  xx1 := xx1 + xx;
  yy1 := yy1 + yy;
  xx2 := xx2 + xx;
  yy2 := yy2 + yy;
end;

function vprod(x1, y1, x2, y2: double): double;
begin
  vprod := x1 * y2 - x2 * y1;
end;

function checkcardcross(c: integer; x1, y1, x2, y2, x3, y3, x4, y4: double): boolean;
var
  xx1, yy1, xx2, yy2: double;
begin
  xx1 := x[c]; yy1 := y[c]; xx2 := v[c]; yy2 := w[c];
  checkcardcross :=
    cross(x1, y1, x2, y2, xx1, yy1, xx2, yy2, false) or
    cross(x2, y2, x4, y4, xx1, yy1, xx2, yy2, false) or
    cross(x4, y4, x3, y3, xx1, yy1, xx2, yy2, false) or
    cross(x3, y3, x1, y1, xx1, yy1, xx2, yy2, false) or
    isinside(x1, y1, x2, y2, x3, y3, x4, y4, xx1, yy1) or
    isinside(x1, y1, x2, y2, x3, y3, x4, y4, xx1, yy1);
end;

var
  i, j, n, t: integer;
  xx1, yy1, xx2, yy2, xx3, yy3, xx4, yy4: double;
  st: array [1..100] of boolean;
  cc: array [1..100] of integer;
  ccnt: integer;
  ok: boolean;
begin
  h := 100;
  calcx2y2(0, 0, 10, 0, xx3, yy3, xx4, yy4);
//  assign(fi,'input.txt'); reset(fi);
//  assign(fo,'output.txt'); rewrite(fo);
  read(n, h);
  for i := 1 to n do
    read(x[i], y[i], v[i], w[i]);
  xx1 := x[1];
  yy1 := y[1];
  xx2 := v[1];
  yy2 := w[1];

  calcx2y2(xx1, yy1, xx2, yy2, xx3, yy3, xx4, yy4);
  if vprod(xx2 - xx1, yy2 - yy1, xx3 - xx1, yy3 - yy1) < 0 then begin
    xx3 := xx4;
    yy3 := yy4;
  end;
  xx4 := xx3 + (xx2 - xx1);
  yy4 := yy3 + (yy2 - yy1);

  fillchar(st, sizeof(st), true);
  st[1] := false;
  cc[1] := 1;
  ccnt := 1;
  while true do begin
    ok := true;
    for i := 1 to n do
      if st[i] then
        if checkcardcross(i, xx1, yy1, xx2, yy2, xx3, yy3, xx4, yy4) then begin
          calcx2y2(x[i], y[i], v[i], w[i], xx3, yy3, xx4, yy4);
          if cross(x[i], y[i], xx3, yy3, xx1, yy1, xx2, yy2, true) then begin
            xx3 := xx4;
            yy3 := yy4;
          end;
          xx1 := x[i];
          yy1 := y[i];
          xx2 := v[i];
          yy2 := w[i];
          xx4 := xx3 + (xx2 - xx1);
          yy4 := yy3 + (yy2 - yy1);
          ok := false;
          st[i] := false;
          inc(ccnt);
          cc[ccnt] := i;
          break;
        end;
    if ok then break;
  end;
  for i := 1 to ccnt do
    for j := i + 1 to ccnt do
      if cc[j] < cc[i] then begin
        t := cc[i];
        cc[i] := cc[j];
        cc[j] := t;
      end;
  write(cc[1]);
  for i := 2 to ccnt do
    write(' ', cc[i]);
//  close(fi);
//  close(fo);
end.
