#include <bits/stdc++.h>
int main(void) {
  int a[100][5], n, i, j, k = 0, min = 10000;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d%d%d%d", &a[i][0], &a[i][1], &a[i][2], &a[i][3]);
    a[i][4] = i + 1;
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      if (a[j][0] > a[i][0] && a[j][1] > a[i][1] && a[j][2] > a[i][2]) {
        a[i][3] = 10000;
      }
    }
    if (a[i][3] < min) {
      min = a[i][3];
      k = a[i][4];
    }
  }
  printf("%d", k);
  return 0;
}
