#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m, i, j;
  cin >> n;
  int a[n][5];
  for (i = 0; i < n; i++) {
    cin >> a[i][0] >> a[i][1] >> a[i][2] >> a[i][3];
    a[i][4] = 1;
  }
  int jj;
  int max[4];
  max[0] = a[0][0];
  max[1] = a[0][1];
  max[2] = a[0][2];
  max[3] = a[0][3];
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      if (a[j][0] < a[i][0] && a[j][1] < a[i][1] && a[j][2] < a[i][2]) {
        a[j][4] = 0;
        continue;
      }
    }
  }
  int prize = -1;
  for (i = 0; i < n; i++) {
    if ((prize == -1 || a[i][3] < prize) && a[i][4] == 1) {
      prize = a[i][3];
      jj = i + 1;
    }
  }
  cout << jj;
}
