#include <bits/stdc++.h>
using namespace std;
class laptop {
 public:
  int s, r, h, c;
  bool outdated = false;
};
int main() {
  int n;
  cin >> n;
  laptop l[102];
  int ans = -1;
  for (int i = 1; i <= n; i++) {
    cin >> l[i].s >> l[i].r >> l[i].h >> l[i].c;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (i != j) {
        if (l[i].s < l[j].s and l[i].r < l[j].r and l[i].h < l[j].h) {
          l[i].outdated = true;
        }
      }
    }
    if (l[i].outdated == false) {
      if (ans == -1)
        ans = i;
      else if (l[ans].c > l[i].c)
        ans = i;
    }
  }
  cout << ans;
}
