#include <bits/stdc++.h>
using namespace std;
int speed[100], ram[100], hdd[100], cost[100];
bool old[100];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> speed[i] >> ram[i] >> hdd[i] >> cost[i];
  }
  int sum = 1000000000, idx;
  for (int i = 0; i < n; i++) {
    bool f = false;
    for (int j = 0; j < n; j++) {
      if (i != j && speed[i] < speed[j] && ram[i] < ram[j] && hdd[i] < hdd[j]) {
        old[i] = f = 1;
        break;
      }
      if (f) {
        break;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (!old[i] && cost[i] < sum) sum = cost[i], idx = i;
  }
  cout << idx + 1;
  return 0;
}
