#include <bits/stdc++.h>
using namespace std;
void start() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  cout.precision(10);
}
int32_t main() {
  start();
  long long n;
  cin >> n;
  vector<long long> cc(n), a(n), b(n), c(n);
  long long ans = INT_MAX, ind = -1;
  for (long long i = 0; i < n; i++) {
    cin >> a[i] >> b[i] >> c[i] >> cc[i];
  }
  for (long long i = 0; i < n; i++) {
    long long g = 1;
    for (long long j = 0; j < n && g; j++) {
      if (a[j] > a[i] && b[j] > b[i] && c[j] > c[i]) {
        g = 0;
      }
    }
    if (g) {
      if (cc[i] < ans) {
        ans = cc[i];
        ind = i + 1;
      }
    }
  }
  cout << ind << "\n";
}
