import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int x = in.nextInt(); int y = in.nextInt(); int la[]=new int[n]; int lo[]=new int[n]; int h[]=new int[n]; int p[]=new int[n]; for(int a0 = 0; a0 < n; a0++){ la[a0]= in.nextInt(); lo[a0]= in.nextInt(); h[a0]= in.nextInt(); p[a0]= in.nextInt(); // your code goes here } for(int i=0;ih[j]) { int temp; temp=h[i]; h[i]=h[j]; h[j]=temp; temp=la[i]; la[i]=la[j]; la[j]=temp; temp=lo[i]; lo[i]=lo[j]; lo[j]=temp; temp=p[i]; p[i]=p[j]; p[j]=temp; } } }int sum=0; int i=0; while(i=0) {sum=sum+p[i];} } else sum=sum+p[i]; int j=i+1; while(j=0) {j=i;break;} } j++; }i++; } System.out.println(sum); } }