#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  long long int a[n], b[n], c[n], d[n];
  for (int i = 0; i < n; i++) {
    cin >> 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]) d[i] = 9999999;
    }
  }
  long long int min = d[0], ans = 0;
  for (int i = 1; i < n; i++) {
    if (d[i] < min) {
      min = d[i];
      ans = i;
    }
  }
  cout << ans + 1 << endl;
  return 0;
}
