#include <bits/stdc++.h>
using namespace std;
struct Data {
  int a, b, c;
  int cost, pos;
  bool mark;
} o[110];
bool cmp(Data a, Data b) { return a.cost < b.cost; }
int main() {
  memset(o, 0, sizeof(o));
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> o[i].a >> o[i].b >> o[i].c >> o[i].cost;
    o[i].pos = i + 1;
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (o[j].a > o[i].a && o[j].b > o[i].b && o[j].c > o[i].c) {
        o[i].mark = 1;
        break;
      }
    }
  }
  sort(o, o + n, cmp);
  for (int i = 0; i < n; ++i) {
    if (!o[i].mark) {
      cout << o[i].pos << endl;
      break;
    }
  }
  return 0;
}
