c=24000

exec(c*2*f'i,j=c%200,c//200;i**5-j**5-{input()}or exit(print(i,j));c-=1;')
M=120

c=M*M

exec(c*2*f'i,j=c%M,c//M;c-=i**5-j**5!={input()}or exit(print(i,j));')
c = 24000
exec(c * 2 * f"i,j=c%200,c//200;i**5-j**5-{input()}or exit(print(i,j));c-=1;")

M = 120
c = M * M
exec(c * 2 * f"i,j=c%M,c//M;c-=i**5-j**5!={input()}or exit(print(i,j));")

-c = 24000 -exec(c * 2 * f"i,j=c%200,c//200;i**5-j**5-{input()}or exit(print(i,j));c-=1;") +M = 120 +c = M * M +exec(c * 2 * f"i,j=c%M,c//M;c-=i**5-j**5!={input()}or exit(print(i,j));")