#include <bits/stdc++.h>
int main() {
  int a[105][4], key, i, j, n, c[105], found = 0, min = 1005, ans;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    for (j = 0; j < 4; j++) {
      scanf("%d", &a[i][j]);
    }
  }
  for (i = 0; i < n; i++) {
    j = 0;
    found = 0;
    key = i;
    while (j < n && found == 0) {
      if (a[j][0] > a[i][0] && a[j][1] > a[i][1] && a[j][2] > a[i][2] &&
          j != key && found == 0) {
        c[i] = 0;
        found = 1;
      }
      j++;
    }
    if (found == 0) {
      c[i] = a[i][3];
    } else if (found == 1) {
      c[i] = 0;
    }
  }
  for (i = 0; i < n; i++) {
    if (c[i] != 0 && c[i] < min) {
      min = c[i];
      ans = i;
    }
  }
  printf("%d", ans + 1);
  return 0;
}
