#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<vector<int> > val(n, vector<int>(5));
  for (int i = 0; i < (n); ++i) {
    for (int j = 0; j < (4); ++j) {
      cin >> val[i][3 - j];
    }
    val[i][4] = i + 1;
  }
  sort(val.begin(), val.end());
  for (int i = 0; i < (n); ++i) {
    bool ok = true;
    for (int j = 0; j < (n); ++j) {
      if (val[j][1] > val[i][1] && val[j][2] > val[i][2] &&
          val[j][3] > val[i][3])
        ok = false;
      if (!ok) break;
    }
    if (ok) {
      cout << val[i][4] << endl;
      return 0;
    }
  }
  cout << n << endl;
  return 0;
}
