#include <bits/stdc++.h>
using namespace std;
set<char> st;
map<long long, long long> mp, mploop;
int main() {
  long long n;
  cin >> n;
  long long speed[n + 1], ram[n + 1], hdd[n + 1], cost[n + 1];
  for (long long i = 0; i < n; i++) {
    cin >> speed[i] >> ram[i] >> hdd[i] >> cost[i];
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      if (i == j)
        continue;
      else {
        if (speed[i] < speed[j] && ram[i] < ram[j] && hdd[i] < hdd[j])
          mp[i] = 1;
      }
    }
  }
  long long index = 0;
  long long val = 999999;
  for (long long i = 0; i < n; i++) {
    if (mp[i] == 0) {
      if (cost[i] < val) {
        index = i;
        val = cost[i];
      }
    }
  }
  mp.clear();
  cout << index + 1 << endl;
  return 0;
}
