mi :: Int
mi = -200

ma :: Int
ma = 200

main = do
  x <-read <$> getLine 
  let (a,b) = solve x
  print a
  print b


ok ::Int -> (Int,Int) -> Bool
ok x (a,b) = a*a*a*a*a-b*b*b*b*b == x

solve :: Int -> (Int,Int)
solve = solve' mi mi

solve' :: Int -> Int -> Int -> (Int,Int)
solve' n m x
  | ok x (n,m) = (n,m)
  | n == ma   = solve' mi (m+1) x
  | m == ma   = (0,0)
  | otherwise  = solve' (n+1) m x