#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
struct note {
  int speed, ram, hdd, cost;
};
note a[113];
int main() {
  bool b[113];
  memset(b, 0, sizeof(b));
  int mni = 0;
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].speed >> a[i].ram >> a[i].hdd >> a[i].cost;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (i == j) continue;
      if (!b[i]) {
        if (a[i].speed < a[j].speed && a[i].ram < a[j].ram &&
            a[i].hdd < a[j].hdd) {
          b[i] = true;
        }
      }
    }
  }
  int mn = 1000000;
  for (int i = 1; i <= n; i++) {
    if (!b[i]) {
      if (a[i].cost < mn) {
        mni = i;
        mn = a[i].cost;
      }
    }
  }
  cout << mni;
}
