#include<iostream>
using namespace std;
struct node {
unsigned int a;
unsigned int b;
unsigned int g;
unsigned int k;
unsigned int num;
unsigned int size;
};
node q[10010];
bool puanduan(node a,int x,int y)
{
if (x >= a.a && x <= a.a + a.g && y >= a.b && y <= a.b + a.k)
return 1;
else return 0;
}
int main()
{
int max = 0;
int n;
cin >> n;
for (int i = 1; i < n+1; i++)
{
q[i].num = i;
cin >> q[i].a >> q[i].b >> q[i].g >> q[i].k;
q[i].size = q[i].k * q[i].g;
}
int x, y;
cin >> x >> y;
for (int i = 1; i < n+1; i++)
{
if(puanduan(q[i], x, y))
{
if (q[max].size <= q[i].size)
max = i;
}
}
if (max == 0)
cout << -1;
else
cout << max;
}
03-31
3124
04-03
1397
12-16
3885
03-16
1786