#include <bits/stdc++.h>
using namespace std;
int main() {
  int spd[101], hdd[101], ram[101], cost[101];
  int i, j, n, max;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> spd[i] >> ram[i] >> hdd[i] >> cost[i];
  }
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++)
      if (spd[i] < spd[j] && hdd[i] < hdd[j] && ram[i] < ram[j]) cost[i] = 1001;
  max = cost[0];
  j = 0;
  for (i = 0; i < n; i++)
    if (cost[i] < max) {
      max = cost[i];
      j = i;
    }
  cout << j + 1 << endl;
  return 0;
}
