#include <bits/stdc++.h>
using namespace std;
int a[110], b[110], c[110], d[110];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i] >> b[i] >> c[i] >> d[i];
  int best = -1;
  for (int i = 0; i < n; i++) {
    int j;
    for (j = 0; j < n; j++)
      if (a[j] > a[i] && b[j] > b[i] && c[j] > c[i]) break;
    if (j < n) continue;
    if (best == -1 || d[best] > d[i]) best = i;
  }
  cout << best + 1 << endl;
  return 0;
}
