#include <bits/stdc++.h>
const int maxx = 10010;
const int inf = 0x3f3f3f3f;
using namespace std;
struct node {
  int speed, ram, hdd, cost;
} edge[maxx];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++)
    scanf("%d%d%d%d", &edge[i].speed, &edge[i].ram, &edge[i].hdd,
          &edge[i].cost);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (i != j) {
        if (edge[i].speed < edge[j].speed && edge[i].ram < edge[j].ram &&
            edge[i].hdd < edge[j].hdd)
          edge[i].cost = 1010;
      }
    }
  }
  int k = -1;
  int minn = 1010;
  for (int i = 1; i <= n; i++) {
    if (edge[i].cost < minn) {
      minn = edge[i].cost;
      k = i;
    }
  }
  printf("%d\n", k);
  return 0;
}
