#include <bits/stdc++.h>
using namespace std;
struct lol {
  int a, b, c, d;
  lol(int x = 0, int y = 0, int z = 0, int k = 0) {
    a = x;
    b = y;
    c = z;
    d = k;
  }
};
bool take[105];
int main() {
  int n;
  vector<lol> v;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int a, b, c, d;
    scanf("%d%d%d%d", &a, &b, &c, &d);
    v.push_back(lol(a, b, c, d));
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (j == i) continue;
      take[j] |= (v[j].a < v[i].a && v[j].b < v[i].b && v[j].c < v[i].c);
    }
  }
  int mn = 2 * 1e9;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (take[i]) continue;
    if (mn > v[i].d) {
      mn = v[i].d;
      ans = i;
    }
  }
  cout << ans + 1 << endl;
  return 0;
}
