#include <bits/stdc++.h>
using namespace std;
bool outdate[108];
typedef struct {
  int speed;
  int ram;
  int hdd;
  int cost;
} Node;
Node a[108];
int isout(int i, int j) {
  if (a[i].speed < a[j].speed && a[i].ram < a[j].ram && a[i].hdd < a[j].hdd)
    return -1;
  if (a[i].speed > a[j].speed && a[i].ram > a[j].ram && a[i].hdd > a[j].hdd)
    return 1;
  return 0;
}
int main() {
  int n = 0;
  int ans = 0;
  int mincost = 1024;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d%d%d%d", &a[i].speed, &a[i].ram, &a[i].hdd, &a[i].cost);
  }
  for (int i = 0; i < n; ++i) {
    if (!outdate[i])
      for (int j = i + 1; j < n; ++j) {
        int jud = isout(i, j);
        if (jud == -1)
          outdate[i] = true;
        else if (jud == 1)
          outdate[j] = true;
      }
  }
  for (int i = 0; i < n; ++i)
    if (!outdate[i]) {
      mincost = min(mincost, a[i].cost);
      if (mincost == a[i].cost) ans = i + 1;
    }
  printf("%d\n", ans);
  return 0;
}
