open System

let x = Console.ReadLine() |> int

let f a b =
    let pow5 x =
        x * x * x * x * x
    pow5 a - pow5 b

let a, b =
    let mutable a, b = 0, 0
    let mutable d = 1
    let mutable found = f a b = x

    while not found do
        if d % 2 = 1 then
            for i in 1 .. d do
                if not found then
                    a <- a + 1
                    found <- f a b = x
            for i in 1 .. d do
                if not found then
                    b <- b - 1
                    found <- f a b = x

        else
            for i in 1 .. d do
                if not found then
                    a <- a - 1
                    found <- f a b = x
            for i in 1 .. d do
                if not found then
                    b <- b + 1
                    found <- f a b = x

    a, b

printf "%d %d" a b
