#include <bits/stdc++.h>
using namespace std;
struct node {
  int wh, a, b, c, cst;
  node(int WH, int A, int B, int C, int CST) {
    wh = WH;
    a = A;
    b = B;
    c = C;
    cst = CST;
  }
  bool operator<(const node &t) const { return cst < t.cst; }
};
vector<node> v1, v2;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    v1.push_back(node(i + 1, a, b, c, d));
  }
  for (int i = 0; i < n; i++) {
    bool b = true;
    for (int j = 0; j < n; j++)
      if (v1[i].a < v1[j].a && v1[i].b < v1[j].b && v1[i].c < v1[j].c)
        b = false;
    if (b) v2.push_back(v1[i]);
  }
  sort(v2.begin(), v2.end());
  cout << v2[0].wh << endl;
  return 0;
}
