#include <bits/stdc++.h>
using namespace std;
int a[200], b[200], c[200], cost[200], n;
bool d[200];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d%d%d", &a[i], &b[i], &c[i], &cost[i]);
    d[i] = true;
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++)
      if ((a[j] < a[i]) && (b[j] < b[i]) && (c[j] < c[i])) d[j] = false;
  int price = 100000, p = 0;
  for (int i = 1; i <= n; i++)
    if ((d[i] == true) && (cost[i] < price)) {
      price = cost[i];
      p = i;
    }
  printf("%d\n", p);
  return 0;
}
