import Control.Applicative ((<$>)) main :: IO () main = solve <$> readLn >>= putStrLn solve :: Int -> String solve m = f 2 m where f d x | d ^ 2 > x = "1 " ++ show x | x `mod` d == 0 = show d ++ " " ++ show (x `div` d) | otherwise = f (d+1) x