#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e5 + 10;
int n;
int a[N][4];
bool bad[N];
void solve() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < 4; ++j) {
      cin >> a[i][j];
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      bool all_better = true;
      for (int k = 0; k < 3; ++k) {
        if (a[i][k] >= a[j][k]) {
          all_better = false;
        }
      }
      if (all_better) {
        bad[i] = true;
      }
    }
  }
  int idx = -1;
  for (int i = 0; i < n; ++i)
    if (!bad[i]) {
      if (idx == -1)
        idx = i;
      else {
        if (a[idx][3] > a[i][3]) {
          idx = i;
        }
      }
    }
  cout << idx + 1 << '\n';
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(20);
  cout << fixed;
  solve();
  cout.flush();
  return 0;
}
