
check x a b = x == (a ^ 5 - b ^ 5)


sqrt5Round x
	| x >= 0 = round $ exp (0.2 * log (fromIntegral x))
	| otherwise = (0 - ) $ sqrt5Round $ 0 - x

solve :: Int -> (Int, Int)
solve x = head [(a, (sqrt5Round ((a ^ 5) - x))) | a <- [0..], check x a (sqrt5Round ((a ^ 5) - x))]

show' :: (Int, Int) -> String
show' (a, b) = show a ++ " " ++ show b


main :: IO ()
main = interact $ show' . solve . read
