#include <bits/stdc++.h>
const double E = 1e-8;
const double PI = acos(-1);
using namespace std;
int n, sp[111], rm[111], hd[111], cs[111], mn = 2222, ans;
int main(int argc, char** argv) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> sp[i] >> rm[i] >> hd[i] >> cs[i];
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (sp[i] < sp[j] && rm[i] < rm[j] && hd[i] < hd[j]) cs[i] = 1111;
    }
  }
  for (int i = 0; i < n; ++i) {
    if (mn > cs[i]) {
      mn = cs[i];
      ans = i + 1;
    }
  }
  cout << ans << endl;
  return 0;
}
