def get(n):

    for i in range(-1000,1001):

        for j in range(-1000,1001):

            if(i**5-j**5==n):

                print((i,j))

                return

n=int(eval(input()))

get(n)
l=[]

for i in range(0,1001):

    l.append(i**5)

n=int(eval(input()))

for i in range(0,1001):

    if((l[i]-n) in l):

        print((i,l.index(l[i]-n)))

        break

    elif((n-l[i]) in l):

        print((i,-l.index(-l[i]+n)))

        break



        

    
def get(n):
    for i in range(-1000, 1001):
        for j in range(-1000, 1001):
            if i**5 - j**5 == n:
                print((i, j))
                return


n = int(eval(input()))
get(n)

l = []
for i in range(0, 1001):
    l.append(i**5)
n = int(eval(input()))
for i in range(0, 1001):
    if (l[i] - n) in l:
        print((i, l.index(l[i] - n)))
        break
    elif (n - l[i]) in l:
        print((i, -l.index(-l[i] + n)))
        break

-def get(n): -    for i in range(-1000, 1001): -        for j in range(-1000, 1001): -            if i**5 - j**5 == n: -                print((i, j)) -                return - - +l = [] +for i in range(0, 1001): +    l.append(i**5) -get(n) +for i in range(0, 1001): +    if (l[i] - n) in l: +        print((i, l.index(l[i] - n))) +        break +    elif (n - l[i]) in l: +        print((i, -l.index(-l[i] + n))) +        break