main = readLn >>= putStrLn.format.answer

format (a,b) = show a ++ " " ++ show b

answer :: Integer -> (Integer,Integer)
answer x = head $ filter judge [(a,b) | a <- [-118..119], b <- [-119..118], a > b] where
    judge (a,b) = x == a^5 - b^5