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