#include <bits/stdc++.h>
using namespace std;
struct Notebook {
  int speed;
  int ram;
  int hdd;
  int cost;
};
Notebook mass[101];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i)
    cin >> mass[i].speed >> mass[i].ram >> mass[i].hdd >> mass[i].cost;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (i == j) continue;
      if ((mass[i].speed < mass[j].speed) && (mass[i].ram < mass[j].ram) &&
          (mass[i].hdd < mass[j].hdd)) {
        mass[i].speed = 0;
        mass[i].ram = 0;
        mass[i].hdd = 0;
        mass[i].cost = 100000;
      }
    }
  }
  int min = 10000;
  short position = 0;
  for (int i = 0; i < n; ++i) {
    if (mass[i].cost < min) {
      min = mass[i].cost;
      position = (short)i + 1;
    }
  }
  cout << position;
  return 0;
}
