#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
const double PI = acos(-1.);
template <class T>
inline T sq(T x) {
  return x * x;
}
void solve() {
  int n, data[128][4];
  cin >> n;
  for (int i = (0); i < (n); ++i) {
    for (int j = (0); j < (4); ++j) {
      cin >> data[i][j];
    }
  }
  int od[128] = {};
  for (int i = (0); i < (n); ++i) {
    for (int j = (0); j < (n); ++j) {
      int flg = 1;
      for (int k = (0); k < (3); ++k) {
        if (data[j][k] <= data[i][k]) {
          flg = 0;
          break;
        }
      }
      if (flg) {
        od[i] = 1;
        break;
      }
    }
  }
  int ans, min = 0;
  for (int i = (0); i < (n); ++i) {
    if (!od[i] && (!min || data[i][3] < min)) {
      ans = i;
      min = data[i][3];
    }
  }
  cout << ans + 1 << endl;
}
int main() {
  solve();
  return 0;
}
