#include <bits/stdc++.h>
using namespace std;
long long n, m, a, b;
int ans = 1e9;
bool visited[20009];
bool flag;
vector<long long> v[20009];
int x[109], y[109], z[109], w[109];
int main() {
  cin >> n;
  int min_ = 1e9;
  for (int i = 0; i < n; i++) cin >> x[i] >> y[i] >> z[i] >> w[i];
  for (int i = 0; i < n; i++) {
    flag = false;
    for (int j = 0; j < n; j++) {
      {
        if (x[i] < x[j] && y[i] < y[j] && z[i] < z[j]) flag = true;
      }
    }
    if (flag == false && (min_ == 1e9 || w[i] < min_)) min_ = w[i], a = i;
  }
  cout << a + 1 << endl;
}
