#include <bits/stdc++.h>
using namespace std;
int s[110], r[110], h[110], c[110];
int main() {
  memset(s, 0, 110);
  memset(r, 0, 110);
  memset(h, 0, 110);
  memset(c, 0, 110);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> s[i] >> r[i] >> h[i] >> c[i];
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (i != j && s[i] < s[j] && r[i] < r[j] && h[i] < h[j]) {
        c[i] = 1002;
        break;
      }
    }
  }
  int re = c[1], index = 1;
  for (int i = 1; i <= n; i++) {
    if (re > c[i]) {
      re = c[i];
      index = i;
    }
  }
  cout << index << endl;
  return 0;
}
