#include <bits/stdc++.h>
using namespace std;
int l[105][5];
int m[105], n;
int menor(int i, int j) {
  return (l[i][0] < l[j][0]) && (l[i][1] < l[j][1]) && (l[i][2] < l[j][2]);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++)
    scanf("%d%d%d%d", &l[i][0], &l[i][1], &l[i][2], &l[i][3]);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      if (menor(i, j)) {
        m[i] = 1;
      }
  int mm = 100000, p = 0;
  for (int i = 0; i < n; i++)
    if (!m[i])
      if (l[i][3] < mm) {
        mm = l[i][3];
        p = i + 1;
      }
  printf("%d", p);
}
