-- yukicoder My Practice -- author: Leonardone @ NEETSDKASU main = readLn >>= print . f where f x = g 3 where g i | mod x i == 0 = i | i * i > x = if mod x 2 == 0 then div x 2 else x | otherwise = g (i + 1)