#include <bits/stdc++.h>
using namespace std;
int arr[1001][1001];
map<int, int> out;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 4; j++) {
      cin >> arr[i][j];
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (i == j) continue;
      int outdated = 1;
      for (int k = 0; k < 3; k++) {
        if (arr[i][k] >= arr[j][k]) {
          outdated = 0;
          break;
        }
      }
      if (outdated) {
        out[i] = 1;
        break;
      }
    }
  }
  vector<pair<int, int>> ans;
  for (int i = 0; i < n; i++) {
    if (!out[i]) {
      ans.push_back({arr[i][3], i + 1});
    }
  }
  sort(ans.begin(), ans.end());
  cout << ans[0].second;
  return 0;
}
