#include <bits/stdc++.h>
struct laptop {
  int no, s, r, h, c;
} l[111];
int flag[111];
int cmp(const void *_p, const void *_q) {
  struct laptop *p = (struct laptop *)_p;
  struct laptop *q = (struct laptop *)_q;
  return p->c - q->c;
}
int main() {
  int n;
  while (~scanf("%d", &n)) {
    for (int i = 0; i < n; i++) {
      int s, r, h, c;
      scanf("%d %d %d %d", &l[i].s, &l[i].r, &l[i].h, &l[i].c);
      l[i].no = i + 1;
    }
    memset(flag, 1, sizeof(flag));
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (l[i].s < l[j].s && l[i].r < l[j].r && l[i].h < l[j].h &&
            l[i].c < l[j].c) {
          flag[i] = 0;
        }
      }
    }
    struct laptop t[111];
    int cnt = 0;
    for (int i = 0; i < n; i++) {
      if (flag[i]) {
        t[cnt].no = l[i].no;
        t[cnt].s = l[i].s;
        t[cnt].r = l[i].r;
        t[cnt].h = l[i].h;
        t[cnt].c = l[i].c;
        cnt++;
      }
    }
    qsort(t, cnt, sizeof(struct laptop), cmp);
    printf("%d\n", t[0].no);
  }
  return 0;
}
