#include <bits/stdc++.h>
int main(int argc, char** argv) {
  int n;
  std::cin >> n;
  int speed[n];
  int ram[n];
  int hdd[n];
  int cost[n];
  bool is_new[n];
  for (int i = 0; i < n; i++) {
    std::cin >> speed[i] >> ram[i] >> hdd[i] >> cost[i];
    is_new[i] = true;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (j == i) continue;
      if (speed[i] < speed[j] && ram[i] < ram[j] && hdd[i] < hdd[j]) {
        is_new[i] = false;
        break;
      }
    }
  }
  int min_id = -1;
  for (int i = 0; i < n; i++) {
    if (!is_new[i]) continue;
    if (min_id == -1) min_id = i;
    if (cost[i] < cost[min_id]) min_id = i;
  }
  std::cout << min_id + 1;
  return 0;
}
