#include <bits/stdc++.h>
using namespace std;
struct lap {
  int speed;
  int ram;
  int hdd;
  int cost;
  int index;
};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int vis[n];
  struct lap arr[n];
  for (int i = 0; i < n; i++) {
    vis[i] = 0;
    int s, r, h, c;
    cin >> s >> r >> h >> c;
    arr[i].speed = s;
    arr[i].ram = r;
    arr[i].hdd = h;
    arr[i].cost = c;
    arr[i].index = i + 1;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (arr[j].speed < arr[i].speed and arr[j].ram < arr[i].ram and
          arr[j].hdd < arr[i].hdd)
        vis[j] = 1;
    }
  }
  int price = INT_MAX;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (vis[i] == 0) {
      if (arr[i].cost < price) {
        price = arr[i].cost;
        ans = i;
      }
    }
  }
  cout << ans + 1 << endl;
  return 0;
}
