using System; using System.Collections.Generic; using System.Linq; class Program { static void Main(string[] args) { new Magatro().Solve(); } } public class Magatro { private long H, L; private void Scan() { string[] s = Console.ReadLine().Split(' '); H = long.Parse(s[1]); L = long.Parse(s[0]); } public void Solve() { Scan(); int iMax = (int)Math.Sqrt(H); long max = -1; long ans = -1; for (long j = iMax; j >= 2; j--) { if (max > j) { break; } for (long i = H / j; i >= j; i--) { if (i * j < L) { break; } long l = i * j; long p = Prime(l); if (max < p) { max = p; ans = l; } else if(max == p) { ans = Math.Max(ans, l); } } } Console.WriteLine(ans); } private long Prime(long l) { for (long i = 2; i * i <= l; i++) { if (l % i == 0) return i; } return l; } }