#include <bits/stdc++.h>
using namespace std;
int main() {
  int speed[110], ram[110], hdd[110], cost[110];
  int n;
  int i;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d%d%d%d", &speed[i], &ram[i], &hdd[i], &cost[i]);
  }
  int j;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      if (speed[i] < speed[j] && ram[i] < ram[j] && hdd[i] < hdd[j]) {
        cost[i] = INT_MAX;
        break;
      }
    }
  }
  int min_cost = INT_MAX, number = 1;
  for (i = 0; i < n; i++) {
    if (cost[i] < min_cost) {
      min_cost = cost[i];
      number = i + 1;
    }
  }
  printf("%d\n", number);
}
