#include <bits/stdc++.h>
struct node {
  int speed;
  int ram;
  int hdd;
  int sum;
  int cost;
} lp[101];
int main() {
  int n;
  int i;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d%d%d%d", &lp[i].speed, &lp[i].ram, &lp[i].hdd, &lp[i].cost);
    lp[i].sum = lp[i].speed + lp[i].ram + lp[i].hdd;
  }
  int j, min_cost = 1000000000, min = -1;
  for (i = 1; i <= n; i++) {
    int flag = 0;
    for (j = 1; j <= n; j++) {
      if (i == j) continue;
      if ((lp[i].speed < lp[j].speed && lp[i].hdd < lp[j].hdd &&
           lp[i].ram < lp[j].ram)) {
        flag = 1;
        break;
      }
    }
    if (!flag) {
      if (lp[i].cost < min_cost) {
        min_cost = lp[i].cost;
        min = i;
      }
    }
  }
  printf("%d", min);
  return 0;
}
