#include <bits/stdc++.h>
int s[101];
int r[101];
int h[101];
int c[101];
bool outdated[101];
int main() {
  int n;
  std::cin >> n;
  for (int i = 0; i < n; i++) {
    std::cin >> s[i] >> r[i] >> h[i] >> c[i];
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (i == j) continue;
      if (s[j] < s[i] && r[j] < r[i] && h[j] < h[i] && c[j] < c[i]) {
        outdated[j] = true;
      }
    }
  }
  int x = 1e9, ans = 0;
  for (int i = 0; i < n; i++) {
    if (outdated[i]) continue;
    if (c[i] < x) {
      x = c[i];
      ans = i;
    }
  }
  std::cout << ans + 1 << '\n';
  return 0;
}
