#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  int n, arr[101][4], price = 2000, num = 0;
  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++) {
    bool f = 0;
    for (int j = 0; j < n; j++) {
      int c = 0;
      for (int k = 0; k < 3; k++)
        if (arr[i][k] < arr[j][k]) c++;
      if (c == 3) {
        f = 1;
        break;
      }
    }
    if (f) continue;
    if (arr[i][3] < price) {
      price = arr[i][3];
      num = i + 1;
    }
  }
  cout << num;
  return 0;
}
