-- yukicoder My Practice -- author: Leonardone @ NEETSDKASU import Data.List main = readLn >>= \n -> print $ g n 1 $ primes [2..] where f (x, c) p | x == z * p = f (z, c + 1) p | c == r * 2 = [x, 1] | otherwise = [x, p] where {z = div x p; r = div c 2} 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, x > p * (div x p)]