#include <bits/stdc++.h>
using namespace std;
int s[100], n, r[100], h[100], c[100], mni = -1;
bool bad;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> s[i] >> r[i] >> h[i] >> c[i];
  for (int i = 0; i < n; i++) {
    bad = false;
    for (int j = 0; j < n; j++) {
      if (s[i] < s[j] && r[i] < r[j] && h[i] < h[j]) bad = true;
    }
    if (!bad) {
      if (mni == -1 || c[i] < c[mni]) mni = i;
    }
  }
  cout << mni + 1;
  return 0;
}
