#include <bits/stdc++.h>
using namespace std;
const int inf = int(1e9) + 7;
const int MX = 100500;
int a[MX];
int b[MX];
int c[MX];
int d[MX];
int main() {
  ios_base::sync_with_stdio(false);
  int ans = 0;
  c[0] = 1e9;
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i] >> b[i] >> d[i] >> c[i];
  }
  for (int i = 1; i <= n; i++) {
    bool ok = true;
    for (int j = 1; j <= n; j++) {
      if (a[j] > a[i] && b[j] > b[i] && d[j] > d[i]) ok = false;
    }
    if (ok && c[ans] > c[i]) ans = i;
  }
  cout << ans << endl;
  return 0;
}
