#include <bits/stdc++.h>
using namespace std;
struct data {
  int speed;
  int ram;
  int hhd;
  int cost;
};
int top;
int b[100];
int ss(data x, data y) {
  if (x.speed < y.speed && x.ram < y.ram && x.hhd < y.hhd)
    return 1;
  else
    return 0;
}
int main() {
  int n, res, minn = 10000;
  data a[100];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i].speed >> a[i].ram >> a[i].hhd >> a[i].cost;
  }
  for (int i = 0; i < n; i++) {
    b[i] = 1;
    for (int j = 0; j < n; j++)
      if (ss(a[i], a[j]) == 1) b[i] = 0;
  }
  for (int i = 0; i < n; i++)
    if (b[i] == 1 && a[i].cost < minn) {
      res = i + 1;
      minn = a[i].cost;
    }
  cout << res;
}
