#include <bits/stdc++.h>
using namespace std;
int main() {
  bool comp[101];
  int speed[101], ram[101], hdd[101], cost[101];
  cost[0] = 1001;
  int mcost = 0, n, i, j;
  memset(comp, 1, sizeof(comp));
  cin >> n;
  for (i = 1; i <= n; i++) {
    scanf("%d%d%d%d", &speed[i], &ram[i], &hdd[i], &cost[i]);
  }
  for (i = 1; i <= n; i++)
    for (j = 1; j <= n; j++)
      if (i != j &&
          ((speed[i] < speed[j]) && (ram[i] < ram[j]) && (hdd[i] < hdd[j])))
        comp[i] = 0;
  for (i = 1; i <= n; i++) {
    if (comp[i] && cost[i] < cost[mcost]) mcost = i;
  }
  printf("%d\n", mcost);
  return 0;
}
