#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int speed[n], ram[n], hdd[n], cost[n];
  for (int i = 0; i < n; i++) {
    cin >> speed[i] >> ram[i] >> hdd[i] >> cost[i];
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (speed[i] < speed[j] && ram[i] < ram[j] && hdd[i] < hdd[j]) {
        cost[i] = 10001;
      }
    }
  }
  int min = 99999999;
  for (int i = 0; i < n; i++) {
    if (min > cost[i]) {
      min = cost[i];
    }
  }
  int kam = min_element(cost, cost + n) - cost;
  cout << kam + 1;
  return 0;
}
