import Data.Maybe
import qualified Data.IntSet as S

calc :: Integer -> Maybe Integer
calc x = if isJust y then Just (fromJust y * sign) else Nothing
  where
  y = calc' 0 x'
  x' = abs x
  sign = if x > 0 then 1 else -1
  calc' l r
    | l > r = Nothing
    | mm < x' = calc' (m + 1) r
    | mm > x' = calc' l (m - 1)
    | otherwise = Just m
    where
    m = (l + r) `div` 2
    mm = m ^ 5

main :: IO ()
main = do
  x <- read <$> getLine :: IO Integer
  let b = head $ filter (\b -> isJust $ calc $ x + b ^ 5) $ concat $ map (\(a, b) -> [a, b]) $ zip [0 ..] $ map (* (-1)) [0 ..]
      a = fromJust $ calc $ x + b ^ 5
  putStrLn $ show a ++ " " ++ show b
