
solve [m, n] = head $ rec n [m..7400000]
rec 0 xs = xs
rec n (x:xs) = rec (n-1) [ i | i <- xs, mod i x /= 0 ]
               
main = do s <- getContents
          let mns = init $ map (map read . words)  $ lines s
              anss = map solve mns
          putStrLn(unlines $ map show anss)