#include using namespace std; #define s second #define f first long Abs(long n) { return n>0?n:(-n); } int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ ios_base::sync_with_stdio(0); vector > h; int n,x,y; cin>>n>>x>>y; int L[n],p[n],l[n]; for(int i=0;i>l0>>L0>>h0>>P0; l[i]=l0; L[i]=L0; p[i]=P0; h.push_back(make_pair(h0,i)); } sort(h.begin(),h.end()); long ans=0,ind=h[0].s; for(int i=0;i