#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
int CASE = 1;
const int mxn = 2e5 + 1;
const long long INF = 1e18;
bool prime(int n) {
  if (n <= 1) return false;
  if (n == 2 or n == 3) return true;
  if (n % 2 == 0 or n % 3 == 0) return false;
  for (int i = 5; i * i <= n; i += 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
long long __gcd(long long a, long long b) { return !b ? a : __gcd(b, a % b); }
void solve() {
  int val = INT_MAX, ans;
  int n;
  cin >> n;
  vector<vector<int>> v(n, vector<int>(4));
  vector<bool> ok(n, true);
  for (long long i = 0; i < n; i++)
    cin >> v[i][0] >> v[i][1] >> v[i][2] >> v[i][3];
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      if (v[i][0] < v[j][0] and v[i][1] < v[j][1] and v[i][2] < v[j][2])
        ok[i] = false;
    }
  }
  for (long long i = 0; i < n; i++)
    if (ok[i]) {
      if (v[i][3] < val) {
        val = v[i][3];
        ans = i + 1;
      }
    }
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int T = 1;
  while (T--) {
    solve();
  }
  return 0;
}
