#include<bits/stdc++.h>
using namespace std;
int n,x[111],y[111],z[111],cost[111];
int main()
{
cin>>n;
for(int i=0;i<n;i++)
cin>>x[i]>>y[i]>>z[i]>>cost[i];
int ans=-1;
for(int i=0;i<n;i++){
bool bad=false;
for(int j=0;j<n;j++)
if(x[i]<x[j]&&y[i]<y[j]&&z[i]<z[j])
bad=true;
if(!bad)
if(ans==-1||cost[i]<cost[ans])
ans=i;
}
cout<<ans+1<<endl;
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKaW50IG4seFsxMTFdLHlbMTExXSx6WzExMV0sY29zdFsxMTFdOwppbnQgbWFpbigpCnsKCWNpbj4+bjsKCWZvcihpbnQgaT0wO2k8bjtpKyspCgkJY2luPj54W2ldPj55W2ldPj56W2ldPj5jb3N0W2ldOwoJaW50IGFucz0tMTsKCWZvcihpbnQgaT0wO2k8bjtpKyspewoJCWJvb2wgYmFkPWZhbHNlOwoJCWZvcihpbnQgaj0wO2o8bjtqKyspCgkJCWlmKHhbaV08eFtqXSYmeVtpXTx5W2pdJiZ6W2ldPHpbal0pCgkJCQliYWQ9dHJ1ZTsKCQlpZighYmFkKQoJCQlpZihhbnM9PS0xfHxjb3N0W2ldPGNvc3RbYW5zXSkKCQkJCWFucz1pOwoJfQoJY291dDw8YW5zKzE8PGVuZGw7CglyZXR1cm4gMDsKfQ==