#include <bits/stdc++.h>
using namespace std;
struct computer {
  int s, r, h, c;
  bool lessThan(computer i) { return s < i.s && r < i.r && h < i.h; }
};
const int MAXC = 100;
int computers, totes = 1000000, ind;
bool outdated;
computer cList[MAXC + 5];
int main() {
  scanf("%d", &computers);
  for (int i = 1; i <= computers; i++)
    scanf("%d%d%d%d", &cList[i].s, &cList[i].r, &cList[i].h, &cList[i].c);
  for (int i = 1; i <= computers; i++) {
    outdated = false;
    for (int j = 1; j <= computers; j++)
      outdated |= cList[i].lessThan(cList[j]);
    if (!outdated && totes > cList[i].c) totes = cList[i].c, ind = i;
  }
  printf("%d\n", ind);
}
