#include <bits/stdc++.h>
using namespace std;
vector<int> sp, rm, hd, co, inv;
int a, b, c, d, sol;
int main() {
  int N;
  sol = -1;
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> a >> b >> c >> d;
    sp.push_back(a);
    rm.push_back(b);
    hd.push_back(c);
    co.push_back(d);
    inv.push_back(i + 1);
  }
  bool vale;
  for (int i = 0; i < N; i++) {
    vale = true;
    for (int j = 0; j < N; j++) {
      if (sp[j] > sp[i] && rm[j] > rm[i] && hd[j] > hd[i]) vale = false;
    }
    if (vale) {
      if (sol == -1) {
        sol = i;
        continue;
      }
      if (co[i] < co[sol]) sol = i;
    }
  }
  cout << inv[sol] << endl;
  return 0;
}
