#include <bits/stdc++.h>
using namespace std;
struct node {
  int x, y, z, w;
} a[200];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d%d%d", &a[i].x, &a[i].y, &a[i].z, &a[i].w);
  }
  int minx = 10000;
  int u = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (a[i].x < a[j].x && a[i].y < a[j].y && a[i].z < a[j].z) {
        a[i].w = 9999999999;
        break;
      }
    }
    if (a[i].w < minx) {
      minx = a[i].w;
      u = i;
    }
  }
  printf("%d\n", u);
}
