#include <bits/stdc++.h>
using namespace std;
int a[105], b[105], c[105], d[105], n, minn = 1 << 30, rans, flag;
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i] >> b[i] >> c[i] >> d[i];
  for (int i = 1; i <= n; i++) {
    flag = 1;
    for (int j = 1; j <= n; j++)
      if (a[i] < a[j] && b[i] < b[j] && c[i] < c[j]) flag = 0;
    if (flag)
      if (minn > d[i]) minn = d[i], rans = i;
  }
  cout << rans;
  return 0;
}
