#include <bits/stdc++.h>
using namespace std;
const int MAXN = 110;
int N;
struct notlaptop {
  int speed, ram, hdd, cost;
  notlaptop(int a, int b, int c, int d) {
    speed = a;
    ram = b;
    hdd = c;
    cost = d;
  }
  notlaptop()<% %>
};
notlaptop ar[MAXN];
int main() {
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    ar[i] = notlaptop(a, b, c, d);
  }
  int bcost = 1e9, res = -1;
  for (int i = 0; i < N; i++) {
    bool outdated = false;
    for (int j = 0; j < N; j++) {
      if (ar[i].speed < ar[j].speed and ar[i].ram < ar[j].ram and
          ar[i].hdd < ar[j].hdd) {
        outdated = true;
        break;
      }
    }
    if (!outdated) {
      if (ar[i].cost < bcost) {
        bcost = ar[i].cost, res = i + 1;
      }
    }
  }
  cout << res << "\n";
}
