#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  vector<tuple<int, int, int, int> > v, v1;
  int n, a, b, c, d;
  cin >> n;
  while (n--) {
    cin >> a >> b >> c >> d;
    v.push_back(make_tuple(a, b, c, d));
  }
  vector<tuple<int, int, int, int> >::iterator it, it1;
  for (it = v.begin(); it != v.end(); it++) {
    for (it1 = v.begin(); it1 != v.end() && it1 != it; it1++) {
      if (get<0>(*it) < get<0>(*it1) && get<1>(*it) < get<1>(*it1) &&
          get<2>(*it) < get<2>(*it1)) {
        get<0>(*it) = 0;
        get<1>(*it) = 0;
        get<2>(*it) = 0;
        get<3>(*it) = 0;
      } else if (get<0>(*it) > get<0>(*it1) && get<1>(*it) > get<1>(*it1) &&
                 get<2>(*it) > get<2>(*it1)) {
        get<0>(*it1) = 0;
        get<1>(*it1) = 0;
        get<2>(*it1) = 0;
        get<3>(*it1) = 0;
      }
    }
  }
  int mn = INT_MAX;
  c = 0;
  for (it = v.begin(); it != v.end(); it++) {
    c++;
    if (get<3>(*it) != 0) {
      if (get<3>(*it) < mn) {
        mn = get<3>(*it);
        d = c;
      }
    }
  }
  cout << d << "\n";
}
