#include <bits/stdc++.h>
using namespace std;
long long int bg = pow(10, 10);
bool isSmaller(string str1, string str2) {
  int n1 = str1.length(), n2 = str2.length();
  if (n1 < n2) return true;
  if (n2 < n1) return false;
  for (int i = 0; i < n1; i++)
    if (str1[i] < str2[i])
      return true;
    else if (str1[i] > str2[i])
      return false;
  return false;
}
string add(string str1, string str2) {
  if (str1.length() > str2.length()) swap(str1, str2);
  string str = "";
  int n1 = str1.length(), n2 = str2.length();
  reverse(str1.begin(), str1.end());
  reverse(str2.begin(), str2.end());
  int carry = 0;
  for (int i = 0; i < n1; i++) {
    int sum = ((str1[i] - '0') + (str2[i] - '0') + carry);
    str.push_back(sum % 10 + '0');
    carry = sum / 10;
  }
  for (int i = n1; i < n2; i++) {
    int sum = ((str2[i] - '0') + carry);
    str.push_back(sum % 10 + '0');
    carry = sum / 10;
  }
  if (carry) str.push_back(carry + '0');
  reverse(str.begin(), str.end());
  return str;
}
int main() {
  long long int mini = bg, n, pos;
  cin >> n;
  long long int j, i, arr[n][5];
  for (i = 0; i < n; i++) {
    cin >> arr[i][0] >> arr[i][1] >> arr[i][2] >> arr[i][3];
    arr[i][4] = 0;
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      if (arr[i][0] < arr[j][0] && arr[i][1] < arr[j][1] &&
          arr[i][2] < arr[j][2] && j != i)
        arr[i][4] = 1;
    }
  }
  for (i = 0; i < n; i++) {
    if (arr[i][4] == 0) {
      if (mini > arr[i][3]) {
        mini = arr[i][3];
        pos = i;
      }
    }
  }
  cout << pos + 1;
}
