#include <bits/stdc++.h>
int n;
int a[105], b[105], c[105], d[105];
bool gao[105];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d %d %d %d", &a[i], &b[i], &c[i], &d[i]);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j)
      if (a[i] < a[j] && b[i] < b[j] && c[i] < c[j]) {
        gao[i] = 1;
        break;
      }
  }
  int ans, mn = 1 << 30;
  for (int i = 0; i < n; ++i)
    if (!gao[i]) {
      if (d[i] < mn) {
        mn = d[i];
        ans = i + 1;
      }
    }
  printf("%d\n", ans);
  return 0;
}
