//package Awesome; import java.awt.Point; import java.io.*; import java.util.*; class TestClass { static long mod ; public static class Batman{ int lat; int lon; int heigh; int score; public Batman(int lat, int lon, int heigh, int score) { this.lat = lat; this.lon = lon; this.heigh = heigh; this.score = score; } } public static void main(String args[] ) throws java.lang.Exception { InputStream inputStream = System.in; InputReader in = new InputReader(inputStream); //BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); //BufferedReader in = new BufferedReader(new FileReader("C:\\Users\\sompatha\\Desktop\\yes.txt")); //Scanner in = new Scanner(new FileReader("C:\\Users\\Sompathak\\Desktop\\yes.txt")); //PrintWriter pw = new PrintWriter(new FileWriter("C:\\Users\\sompatha\\Desktop\\output.txt")); //InputStream inputStream = System.in; //InputReader in = new InputReader(inputStream); //Scanner in = new Scanner(new InputStreamReader(System.in)); //Scanner in = new Scanner(new FileReader("C:\\Users\\sompatha\\Desktop\\yes.txt")); //we can we will ??? !!!!!! SOM RISES //long startTime = System.currentTimeMillis(); //long startTime = System.currentTimeMillis(); //float endTime = System.currentTimeMillis(); //float totalTime = (endTime - startTime)/(float)1000; //System.out.println(totalTime+" sec....."); //System.out.println(check(2,2)+" "+check_2(2,2)); int n = in.nextInt(); int x = in.nextInt(); int y = in.nextInt(); Batman[] Q = new Batman[n]; for(int i=0;i() { @Override public int compare(Batman a, Batman b) { // TODO Auto-generated method stub return a.heigh-b.heigh; } }); long[] dp = new long[n]; dp[0]=Q[0].score; long max=dp[0]; for(int i=1;i= numChars) { curChar = 0; try { numChars = stream.read(buf); } catch (IOException e) { throw new InputMismatchException(); } if (numChars <= 0) return -1; } return buf[curChar++]; } public int nextInt() { int c = read(); while (isSpaceChar(c)) c = read(); int sgn = 1; if (c == '-') { sgn = -1; c = read(); } int res = 0; do { if (c < '0' || c > '9') throw new InputMismatchException(); res *= 10; res += c - '0'; c = read(); } while (!isSpaceChar(c)); return res * sgn; } public String readString() { int c = read(); while (isSpaceChar(c)) c = read(); StringBuilder res = new StringBuilder(); do { res.appendCodePoint(c); c = read(); } while (!isSpaceChar(c)); return res.toString(); } public double readDouble() { int c = read(); while (isSpaceChar(c)) c = read(); int sgn = 1; if (c == '-') { sgn = -1; c = read(); } double res = 0; while (!isSpaceChar(c) && c != '.') { if (c == 'e' || c == 'E') return res * Math.pow(10, nextInt()); if (c < '0' || c > '9') throw new InputMismatchException(); res *= 10; res += c - '0'; c = read(); } if (c == '.') { c = read(); double m = 1; while (!isSpaceChar(c)) { if (c == 'e' || c == 'E') return res * Math.pow(10, nextInt()); if (c < '0' || c > '9') throw new InputMismatchException(); m /= 10; res += (c - '0') * m; c = read(); } } return res * sgn; } public long readLong() { int c = read(); while (isSpaceChar(c)) c = read(); int sgn = 1; if (c == '-') { sgn = -1; c = read(); } long res = 0; do { if (c < '0' || c > '9') throw new InputMismatchException(); res *= 10; res += c - '0'; c = read(); } while (!isSpaceChar(c)); return res * sgn; } public boolean isSpaceChar(int c) { if (filter != null) return filter.isSpaceChar(c); return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; } public String next() { return readString(); } public interface SpaceCharFilter { public boolean isSpaceChar(int ch); } } }