#include <bits/stdc++.h>
using namespace std;
int main() {
  int input[101][4], n, owakon[101] = {0}, ans = 1, minprice = 9999;
  cin >> n;
  for (int i = 1; i <= n; i++)
    for (int j = 0; j < 4; j++) cin >> input[i][j];
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++) {
      if (input[i][0] < input[j][0] && input[i][1] < input[j][1] &&
          input[i][2] < input[j][2])
        owakon[i] = 1;
      if (input[i][0] > input[j][0] && input[i][1] > input[j][1] &&
          input[i][2] > input[j][2])
        owakon[j] = 1;
    }
  for (int i = 1; i <= n; i++) {
    if (!owakon[i]) {
      if (input[i][3] < minprice) {
        minprice = input[i][3];
        ans = i;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
