x=int(eval(input()))

A=0

B=0

for a in range(-500,500):

    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):

    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(-500, 500):
    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):
    for b in range(-500, 500):
        if a**5 - b**5 == x:
            A = a
            B = b
            break
print((A, B))

-for a in range(-500, 500): +for a in range(-120, 120):