-- yukicoder My Practice -- author: Leonardone @ NEETSDKASU import Data.List main = readLn >>= \n -> print $ g n 1 $ takeWhile (<= n) $ primes [2..] where f (x, c) p | mod x p == 0 = f (div x p, c + 1) p | mod c 2 == 0 = [x, 1] | otherwise = [x, p] g 1 y _ = y g x y (p:ps) = let (x2:k:_) = f (x, 0) p in g x2 (y * k) ps primes [] = [] primes (x:xs) = x : primes [p | p <- xs, mod p x > 0]