#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
const int inf = 999999999;
struct node {
  int sp, ra, hd, cost;
} s[105];
int main() {
  int n;
  while (~scanf("%d", &n)) {
    memset(s, 0, sizeof(s));
    for (int i = 1; i <= n; i++)
      scanf("%d%d%d%d", &s[i].sp, &s[i].ra, &s[i].hd, &s[i].cost);
    for (int i = 1; i < n; i++) {
      for (int j = i + 1; j <= n; j++) {
        if (s[i].sp < s[j].sp && s[i].ra < s[j].ra && s[i].hd < s[j].hd)
          s[i].cost = inf;
      }
    }
    for (int i = n; i > 1; i--) {
      for (int j = i - 1; j > 0; j--) {
        if (s[i].sp < s[j].sp && s[i].ra < s[j].ra && s[i].hd < s[j].hd)
          s[i].cost = inf;
      }
    }
    int min = inf;
    int ii;
    for (int i = 1; i <= n; i++) {
      if (s[i].cost != inf) {
        if (s[i].cost < min) {
          min = s[i].cost;
          ii = i;
        }
      }
    }
    printf("%d\n", ii);
  }
}
