#include <bits/stdc++.h>
int main(void) {
  int n;
  int a[105][4];
  scanf("%d", &n);
  for (int i = 0; i < n; i++)
    scanf("%d%d%d%d", &a[i][0], &a[i][1], &a[i][2], &a[i][3]);
  int w[105] = {};
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      if (a[i][0] > a[j][0] && a[i][1] > a[j][1] && a[i][2] > a[j][2]) w[j] = 1;
  int ans = -1;
  for (int i = 0; i < n; i++)
    if (w[i] == 0 && (ans == -1 || a[i][3] < a[ans][3])) ans = i;
  printf("%d\n", ans + 1);
  return 0;
}
