{-# LANGUAGE BangPatterns #-}

import qualified Data.Vector.Unboxed as U
-- import qualified Data.Vector as V
import qualified Data.ByteString.Char8 as C
import Data.List
import Control.Monad
import Control.Arrow
--import Data.Foldable
--import Data.Char
import qualified Data.IntMap.Strict as IM
--import qualified Data.IntSet as IS
-- import Data.Sequence as Sq

-- r :: Int -> IO (U.Vector Int)
-- r n = U.unfoldrN n (C.readInt . C.dropWhile (==' ')) <$> C.getLine

r' :: IO [Int]
r'  =   unfoldr    (C.readInt . C.dropWhile (==' ')) <$> C.getLine




main = do
    x <- readLn
    let smallerFactors = filter ((==0).(x`mod`)) [1..ceiling (sqrt $ fromIntegral x)]
    let biggerFactors = map (x `div`) smallerFactors
    -- print (smallerFactors,biggerFactors)
    printTup $ head $ map (\((b:_),d) -> (b+d,b)) $ filter (not.null.fst) $ map (\d -> (getExactB x d, d) ) (smallerFactors ++ biggerFactors)


printTup (a,b) = putStrLn $ show a ++ " " ++ show b



getExactB :: Int -> Int -> [Int]
getExactB x d = filter (\b ->  (b+d)^5 - b^5 == x ) (getBRange x d)

getBRange :: Int -> Int -> [Int]
getBRange x d = let m = round $ getB (fromIntegral x) (fromIntegral d)
    in [m-10..m+10]

getB x d = -(1/2)*sqrt(
                    ( (2 * (sqrt (d^6 + 4*d*x)) )   /    (sqrt 5 * d) )
                    -d^2
            )-(d/2)