#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n][4];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 4; j++) cin >> a[i][j];
  }
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      for (int k = 0; k < 3; k++) {
        if (a[i][k] < a[j][k]) cnt++;
      }
      if (cnt == 3) a[i][3] = -1;
      cnt = 0;
    }
  }
  int ans, mnc = INT_MAX;
  for (int i = 0; i < n; i++) {
    if (a[i][3] != -1 && a[i][3] < mnc) mnc = a[i][3], ans = i;
  }
  cout << ans + 1;
}
