import Text.Printf

main :: IO ()
main = do
  x <- readLn
  let (a, b) = solve x
  printf "%d %d\n" a b

solve :: Int -> (Int, Int)
solve 0 = (0, 0)
solve 1 = (1, 0)
solve 2 = (1, -1)
solve x
  | x < 0       = let (a, b) = solve (-x) in (b, a)
  | y == yb ^ 5 = if x < xb ^ 5 then (xb, yb) else (xb, -yb)
  where
    xb = round $ fromIntegral x ** 0.2
    y  = abs $ x - xb ^ 5
    yb = round $ fromIntegral y ** 0.2