import Data.List -- ref: http://d.hatena.ne.jp/mokehehe/20070615/factorization factors :: Integral a => a -> [a] factors n = [x | x <- [1..n], n `mod` x == 0] factorization :: Integral a => a -> [a] factorization 1 = [] factorization x = v : factorization (x `div` v) where v = (factors x) !! 1 solve :: Integral a => a -> a solve x = product $ map head $ filter (odd . length) $ group $ factorization x main = do n <- readLn putStrLn $ show $ solve n