import Data.Maybe
import qualified Data.IntSet as S

calc :: Integer -> Maybe Integer
calc x = calc' 0 x
  where
  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 check = isJust . calc
      b = head $ filter (\b -> check (x + b ^ 5) || check (x - b ^ 5)) [0 ..]
      aa = calc (x + b ^ 5)
      a = fromJust $ if isJust aa then aa else calc (x - b ^ 5)
  putStrLn $ show a ++ " " ++ show b