#include <bits/stdc++.h>
using namespace std;
const int INF = INT_MAX;
const long double PI = acos(-1);
const long double E = 2.71828183;
const int MOD = 1e9 + 7;
vector<int> bfs(vector<vector<int> > adj, int src) {
  queue<int> q;
  q.push(src);
  vector<int> dst(adj.size(), INF);
  dst[src] = 0;
  while (!q.empty()) {
    int c = q.front();
    q.pop();
    for (int nbr : adj[c]) {
      if (dst[nbr] == INF) {
        dst[nbr] = dst[c] + 1;
        q.push(nbr);
      }
    }
  }
  return dst;
}
vector<int> bfsParents(vector<vector<int> > adj, int src) {
  vector<int> parents = vector<int>(adj.size(), INF);
  parents[src] = -1;
  queue<int> q;
  q.push(src);
  vector<int> dst(adj.size(), INF);
  dst[src] = 0;
  while (!q.empty()) {
    int c = q.front();
    q.pop();
    for (int nbr : adj[c]) {
      if (dst[nbr] == INF) {
        parents[nbr] = c;
        dst[nbr] = dst[c] + 1;
        q.push(nbr);
      }
    }
  }
  return parents;
}
list<int> shortestPath(vector<vector<int> > adj, int src, int dst) {
  vector<int> bfsParetns = bfsParents(adj, src);
  list<int> ans;
  ans.push_back(dst);
  while (ans.front() != src) ans.push_front(bfsParetns[ans.front()]);
  return ans;
}
long long powMod(long long base, long long exp, long long mod) {
  long long ans = 1;
  for (long long i = 0; i < exp; i++) ans = ((ans % mod) * (base % mod)) % mod;
  return ans;
}
vector<int> divisorsOf(int n) {
  vector<int> ans;
  for (int i = 1; i * i <= n; i++) {
    if (n % i == 0) ans.push_back(i);
    if (i * i != n && i != 1) ans.push_back(n / i);
  }
  return ans;
}
long long gcd(long long a, long long b) {
  return (a % b == 0 ? b : gcd(b, a % b));
}
long double log(long double a, long double b) { return log(b) / log(a); }
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
long long power(long long base, long long exp) {
  long long res = 1;
  while (exp) {
    exp--;
    res *= base;
  }
  return res;
}
void solve();
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) solve();
  return 0;
}
int x0;
bool canGet(vector<pair<int, int> > s, int k) {
  int x1 = x0 - k, x2 = x0 + k;
  bool b1 = 1, b2 = 1;
  for (int i = 0; i < s.size(); i++) {
    if (!(s[i].first <= x1 && x1 <= s[i].second)) b1 = 0;
    if (!(s[i].first <= x2 && x2 <= s[i].second)) b2 = 0;
  }
  return b1 || b2;
}
vector<vector<int> > v;
void solve() {
  int n;
  cin >> n;
  v = vector<vector<int> >(n);
  for (int i = 0; i < n; i++) {
    int s, r, h, c;
    cin >> s >> r >> h >> c;
    v[i] = {s, r, h, c};
  }
  int mn = -1;
  for (int i = 0; i < n; i++) {
    bool ok = true;
    for (int j = 0; j < n; j++) {
      if (v[j][1] > v[i][1] && v[j][2] > v[i][2] && v[j][0] > v[i][0])
        ok = false;
    }
    if (ok && (mn == -1 || v[i][3] < v[mn][3])) mn = i;
  }
  cout << mn + 1 << "\n";
}
