#include <bits/stdc++.h>
using namespace std;
const int maxint = -1u >> 1;
template <class T>
bool get_max(T& a, const T& b) {
  return b > a ? a = b, 1 : 0;
}
template <class T>
bool get_min(T& a, const T& b) {
  return b < a ? a = b, 1 : 0;
}
const int maxn = 100 + 100;
struct node {
  int speed, ram, hdd, cost, c;
} a[maxn];
bool visit[maxn];
int n;
bool cmp(node a, node b) { return a.cost < b.cost; }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++)
    scanf("%d%d%d%d", &a[i].speed, &a[i].ram, &a[i].hdd, &a[i].cost);
  for (int i = 1; i <= n; i++) a[i].c = i;
  sort(a + 1, a + n + 1, cmp);
  memset(visit, 0, sizeof(visit));
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++)
      if (a[i].speed < a[j].speed && a[i].ram < a[j].ram &&
          a[i].hdd < a[j].hdd) {
        visit[i] = true;
        break;
      }
  }
  for (int i = 1; i <= n; i++)
    if (!visit[i]) {
      printf("%d\n", a[i].c);
      break;
    }
  return 0;
}
