import java.io.*; import java.util.*; class ha4 { public static void main(String[] args) { InputReader s=new InputReader(System.in); PrintWriter p=new PrintWriter(System.out); int n=s.nextInt(); int x=s.nextInt(),y=s.nextInt(); int a[][]=new int[n][4]; for (int i=0;i() { public int compare(int[] x, int[] y) { return Double.compare(x[2], y[2]); } }); long ans=0; int tmp=0; for (int i=0;i 2 && (n & 1) == 0) return false; for(int i = 3; i * i <= n; i += 2) if (n % i == 0) return false; return true; } private static long gcd(long number1, long number2) { if(number2 == 0){ return number1; } return gcd(number2, number1%number2); } private static long lcm(long a, long b) { return a * (b / gcd(a, b)); } static long power(long x, long y) { if( y == 0) return 1; else if (y%2 == 0) return power(x, y/2)*power(x, y/2); else return x*power(x, y/2)*power(x, y/2); } static class InputReader { private InputStream stream; private byte[] buf = new byte[1024]; private int curChar; private int numChars; private SpaceCharFilter filter; public InputReader(InputStream stream) { this.stream = stream; } public static boolean isWhitespace(int c) { return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; } public int read() { if (numChars == -1) throw new InputMismatchException(); if (curChar >= 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 long nextLong() { 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 String nextToken() { 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 boolean isSpaceChar(int c) { if (filter != null) return filter.isSpaceChar(c); return isWhitespace(c); } public interface SpaceCharFilter { public boolean isSpaceChar(int ch); } } }