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

    a5 = a**5

    for b in range(-120, 120):

        if (a5 < x and b >=0 ) or (a5 > x and b <= 0):

            continue

        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):
    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):
    a5 = a**5
    for b in range(-120, 120):
        if (a5 < x and b >= 0) or (a5 > x and b <= 0):
            continue
        if a5 - b**5 == x:
            A = a
            B = b
            break
print((A, B))

+        if (a5 < x and b >= 0) or (a5 > x and b <= 0): +            continue