#include using namespace std; struct S{ long lat,lon,point,in,h; }; bool compp(S a,S b){ return a.h>b.h; } int main(){ int n; int x; int y; cin >> n >> x >> y; S s[n]; for(int i=0;i>s[i].lat>>s[i].lon>>s[i].h>>s[i].point; } sort(s,s+n,compp); // sort(s,s+n,comph); long long ans=s[0].point; //cout<=0){ ans+=s[i].point; temph=s[i].h; //cout<