#include <bits/stdc++.h>
using namespace std;
int main() {
  int f, i, j, n, s[102], r[102], h[102], c[102];
  cin >> n;
  for (i = 1; i < n + 1; i++) {
    cin >> s[i] >> r[i] >> h[i] >> c[i];
  }
  for (i = 1; i < n + 1; i++) {
    for (j = 1; j < n + 1; j++) {
      if (s[i] < s[j] && r[i] < r[j] && h[i] < h[j]) c[i] = 1001;
    }
  }
  f = c[1];
  for (i = 1; i < n; i++) {
    f = min(f, c[i + 1]);
  }
  for (i = 1; i < n + 1; i++)
    if (c[i] == f) cout << i << endl;
  return 0;
}
