main = do
  li <- getLine
  let x = read li
  let (a,b) = compute x
  putStrLn (show a ++ " " ++ show b)

{-
a5 < x のうちは、これに足してxに達するためのマイナスなbを
a5 = x なら b = 0 でいい
a5 > x のときは、ここから引いてxに合わせるためのプラスなbを
探す
-}

frt :: Int -> [Int]
frt n5
  | n^5 == n5 = [n]
  | otherwise = []
 where n = floor ((fromIntegral n5) ** 0.2)

compute :: Int -> (Int,Int)
compute x =  head [ (a,b) | a <- [1..], b <- sub x a ]

sub :: Int -> Int -> [Int]
sub x a = let a5 = a^5 in case compare a5 x of
  EQ -> [0]
  LT -> map negate $ frt (x-a5)
  GT -> frt (a5-x)