#include <bits/stdc++.h>
const int MAXN = 128;
int N;
int speed[MAXN], ram[MAXN], hdd[MAXN], cost[MAXN];
bool dominated(int iii) {
  for (int i = 0; i < N; i++)
    if (speed[iii] < speed[i] && ram[iii] < ram[i] && hdd[iii] < hdd[i])
      return true;
  return false;
}
int main(int argc, char* argv[]) {
  scanf("%d", &N);
  for (int i = 0; i < N; i++)
    scanf("%d %d %d %d", speed + i, ram + i, hdd + i, cost + i);
  int res = -1;
  int curr_min;
  for (int i = 0; i < N; i++)
    if (!dominated(i) && (res == -1 || cost[i] < curr_min))
      curr_min = cost[res = i];
  printf("%d\n", res + 1);
  return 0;
}
