import java.util.*; import java.io.*; import java.awt.geom.*; import java.math.*; public class No006 { static final Scanner in = new Scanner(System.in); static final PrintWriter out = new PrintWriter(System.out,false); static boolean debug = false; static int hash(int p) { int sum = 0; while (p > 0) { sum += p%10; p /= 10; } return sum < 10 ? sum : hash(sum); } static void solve() { int k = in.nextInt(); int n = in.nextInt(); BitSet isp = new BitSet(); isp.set(2, n+1, true); for (int i=2; i*i<=n; i=isp.nextSetBit(i+1)) { for (int j=i+i; j<=n; j+=i) { isp.set(j, false); } } dump(isp); ArrayList primes = new ArrayList<>(); for (int i=isp.nextSetBit(k); i>=0; i=isp.nextSetBit(i+1)) { primes.add(i); } dump(primes); int m = primes.size(); int l = 0, max = 0; int ans = -1; BitSet mask = new BitSet(); ArrayList hashes = new ArrayList<>(); for (int r=0; r 0; long start = System.currentTimeMillis(); solve(); out.flush(); long end = System.currentTimeMillis(); dump((end-start) + "ms"); in.close(); out.close(); } static void dump(Object... o) { if (debug) System.err.println(Arrays.deepToString(o)); } }