using System; using System.Collections.Generic; using System.Linq; class AB { static long T, F; static void Main() { long[] q = Console.ReadLine().Split(' ').Select(s => long.Parse(s)).ToArray(); T = q[0]; F = q[1]; long max = 0; long ans = 0; for(long i = T; i <= F; i++) { long w = MinInsuu(i); if (max <= w) { max = w; ans = i; } } Console.WriteLine(ans); } static long MinInsuu(long l) { for(int i = 2; true; i++) { if (l % i == 0) { if (l == i) { return 0; } else { return i; } } } } }