x=int(eval(input()))

A=0

B=0

for a in range(-120,120):

    for b in range(-500,500):

        if a**5-b**5==x:

            A=a

            B=b

            break

print((A,B))
x=int(eval(input()))

A=0

B=0

for a in range(-120, 120):

    a5 = a**5

    for b in range(-120, 120):

        if a5 - b**5 == x:

            A = a

            B = b

            break

print((A,B))
x = int(eval(input()))
A = 0
B = 0
for a in range(-120, 120):
    for b in range(-500, 500):
        if a**5 - b**5 == x:
            A = a
            B = b
            break
print((A, B))

x = int(eval(input()))
A = 0
B = 0
for a in range(-120, 120):
    a5 = a**5
    for b in range(-120, 120):
        if a5 - b**5 == x:
            A = a
            B = b
            break
print((A, B))

-    for b in range(-500, 500): -        if a**5 - b**5 == x: +    a5 = a**5 +    for b in range(-120, 120): +        if a5 - b**5 == x: