{-# LANGUAGE PartialTypeSignatures #-}
module Main (main) where

import qualified Data.ByteString.Char8 as C8
import qualified Data.Char as C
import qualified Data.List as L

main :: IO ()
main = readInts >>= output . solve

solve :: [Int] -> _
solve [x] = head [(a,b) | a <- [-120..120], b <- [-120..120], a^5-b^5==x]

output :: _ -> IO ()
output (a,b) = putStrLn (show a <> " " <> show b)

-- utils
readInts :: IO [Int]
readInts = L.unfoldr (C8.readInt . C8.dropWhile C.isSpace) <$> C8.getLine
