#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cout << name << " : " << arg1 << "\n";
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
long long int i, j;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  int sp[n], ram[n], hdd[n], c[n], ar[n];
  int z = 0, ans = 1000;
  for (i = 0; i < n; ++i) ar[i] = 1;
  for (i = 0; i < n; ++i) {
    cin >> sp[i] >> ram[i] >> hdd[i] >> c[i];
  }
  for (i = 0; i < n; ++i) {
    for (j = 0; j < n; ++j) {
      if (sp[i] < sp[j] and ram[i] < ram[j] and hdd[i] < hdd[j]) {
        ar[i] = 0;
        break;
      }
    }
  }
  for (i = 0; i < n; ++i) {
    if (ar[i]) {
      ans = min(ans, c[i]);
    }
  }
  for (j = 0; j < n; ++j) {
    if (c[j] == ans) {
      cout << j + 1;
      break;
    }
  }
  return 0;
}
