peterverebics/CodeNet_Python_118 huggingface dataset:
import sys
input = sys.stdin.readline

x = int(input())
a = 1
while True:
    for b in range(0, a):
        if a**5 - b**5 == x:
            print(a, b)
            sys.exit()
        if a**5 + b**5 == x:
            print(a, -b)
            sys.exit()
    a += 1
from bisect import bisect_right
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

def main():
    x = int(readline())

    for a in range(-120, 120):
        for b in range(-120, 120):
            if a**5 - b**5 == x:
                print(a, b)
                exit()


if __name__ == "__main__":
    main()
x = int(input())
for i in range(-1000,1000):
    for j in range(-1000,1000):
        if i**5 - j**5 == x:
            print(i,j)
            quit()
x = int(input())
A=[]
i=1
while i*i<=x:
  if x%i==0:
    A += [i, x//i]
  i += 1
for j in A:
  c= j//2
  a = c
  while a**5-(a-j)**5 < x:
    a +=1
  else:
    if a**5-(a-j)**5 == x:
      print(a,a-j)
      break
X = int(input())

for a in range(-1000, 1001):
    A = a ** 5
    for b in range(-1000, 1000):
        B = b ** 5
        if A - B == X:
            print(a, b)
            exit()
print(-1, -1)
x = int(input())
p5 = [i ** 5 for i in range(121)]

a = 0
b = 0

for _p5 in p5:
  if _p5 + x in p5:
    a = p5.index(_p5 + x)
    b = p5.index(_p5)
    break
  
  if x - _p5 in p5:
    a = p5.index(x - _p5)
    b = -(p5.index(_p5))
    break

print(str(a) + " " + str(b))
x = int(input())
for i in range(400):
  for j in range(400):
    ii = i - 200
    jj = j - 200
    if ii**5 - jj**5 == x:
      print(ii,jj)
      exit()
assert false, "final"
x = int(input())
OP = [+1, -1]
for a in range(1000):
    for b in range(a + 1):
        for op1 in OP:
            for op2 in OP:
                if (op1 * a)**5 - (op2 * b)**5 == x:
                    print(op1 * a, op2 * b)
                    exit()
X = int(input())
A, B = 0, 0
for i in range(-200, 200):
    for j in range(-200, 200):
        if X == i**5 - j**5:
            A = i
            B = j
print(A, B)
import sys
import math
import collections
from collections import deque
from functools import reduce
import heapq
x = int(input())
#n, m = map(int, sys.stdin.readline().split())
#s = input()
#h = list(map(int, sys.stdin.readline().split()))

for i in range(1, 1000):
    for j in range(-1000, 1000):
        if i ** 5 - j ** 5 == x:
            print(i, j)
            sys.exit()
X=int(input())
for A in range(120):
    for B in range(120):
        if A**5-B**5==X:
            print(A,B)
            exit()
        if A**5+B**5==X:
            print(A,B*(-1))
            exit()
n = int(input())

for a in range(-1000, 1000):
    for b in range(-1000, 1000):
        if a**5-b**5 == n:
            print(a, b)
            exit()
X = int(input())

def solve() :
  for a in range(-1000, 1000) :
    for b in range(-1000, 1000) :
      if (a ** 5) - (b ** 5) == X :
        return (a, b)
        
print(*solve())
import bisect
# 計算量を大体で見積もってぶん投げればおｋ
# この問題だとO(a**0.25)
x = int(input())

for i in range(-1000, 1000):
    for j in range(-1000, 1000):
        if i ** 5 - j ** 5 == x:
            print(i, j)
            quit()
X = int(input())
for a in range(-1000, 1000):
    A = a*a*a*a*a
    for b in range(-1000, 1000):
        if A - b*b*b*b*b == X:
            print(a, b)
            exit()
import sys

X = int(input())
for i in range(-500,500):
    for j in range(-500,500):
        if pow(i,5) - pow(j,5) == X:
            print(i,j)
            sys.exit()
X=int(input())
for i in range(-500,500):
    for j in range(-500,500):
        if i**5-j**5==X:
            print(i,j)
            exit()
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors
x=int(input())
l=make_divisors(x)
ll=[(i,i-j) for i in range(200) for j in l]
for a,b in ll:
  if a**5-b**5==x:
    print(a,b)
    break
x = int(input())

flag = True

for a in range(1, 1000):
    a5 = pow(a, 5)
    for b in range(-1000, 1000):
        b5 = pow(b, 5)
        if a5 - b5 == x and flag:
            print(a, b)
            flag = False
X = int(input())

A = range(-118,120)
B = range(-118,120)
flag = 0
for a in A:
  for b in B:
    ans = a**5 - b**5
    if ans == X:
      print("{} {}".format(a,b))
      flag=1
      break
  if flag:
    break
X = int(input())
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors
Y = make_divisors(X)

for i in Y:
    for j in range(-1000,1000):
        A = j
        B = A - i
        if A**5 - B**5 == X:
            print(A,B)
            exit()
x = int(input())

a = -1000
b = -1000

for _ in range(2000):
    for _ in range(2000):
        if (a ** 5) - (b ** 5) == x:
            print('{0} {1}'.format(a,b))
            exit()
        b += 1
    b = -2000
    a += 1
x = int(input())

a = 1
b = 0

def val():
    global a, b
    if pow(a,5) - pow(-b,5) == x:
        b = -b
        return True
    return pow(a,5) - pow(b,5) == x

while not val():
    if a >= b:
        b += 1
    else:
        a += 1
        b = 0
print(a,b)
x = int(input())
for i in range(-120, 121):
    for j in range(-120, 120):
        if i ** 5 - j ** 5 == x:
            print(f'{i} {j}')
            break
    else:
        continue
    break
x = int(input())

pow_li = [pow(i,5) for i in range(1000)]

for i in range(1000):
    for j in range(1000):
        if pow_li[i]-pow_li[j]==x:
            print(i,j);exit()
        elif pow_li[i]+pow_li[j]==x:
            print(i,-j);exit()
x = int(input())
for i in range(-2*10**2,2*10**2):
    for j in range(-2*10**2,2*10**2):
        if i**5- j**5 ==x:
            print(i,j)
            exit()
        elif j**5 - i**5 == x:
            print(j,i)
            exit()
import sys
def Ii():return int(sys.stdin.buffer.read())
def Mi():return map(int,sys.stdin.buffer.readline().split())
def Li():return list(map(int,sys.stdin.buffer.readline().split()))

x = Ii()

for i in range(121):
  for j in range(-119,120):
    if x == i**5 - j**5:
      print(i,j)
      exit(0)
X = int(input())

for b in range(-1000, 1000, 1):
    for a in range(b, 1000, 1):
        if a ** 5 - b ** 5 == X:
            print(a, b)
            exit()
n = int(raw_input())
import sys
for i in xrange(350):
    for j in xrange(i):
        a = i - 175;
        b = j - 175
        if (a**5 - b**5) == n:
            print "{} {}".format(a, b)
            sys.exit(0)
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));')
X=int(input())

for i in range(-1000,1000):
    for j in range(-1000,1000):
        if i**5==j**5+X:
            A=i
            B=j
            break
print(A,B)
from itertools import product

X = int(input())
for a, b in product(range(-200, 201), repeat=2):
    if a**5 - b**5 == X: print(a, b); break
import sys

readline = sys.stdin.readline
readlines = sys.stdin.readlines
ns = lambda: readline().rstrip() # input string
ni = lambda: int(readline().rstrip()) # input int
nm = lambda: map(int, readline().split()) # input multiple int 
nl = lambda: list(map(int, readline().split())) # input multiple int to list

x = ni()
ans_a = 0
ans_b = 0
for a in range(-120, 120):
    for b in range(-120, 120):
        if a**5 - b**5 == x:
            ans_a = a
            ans_b = b

print(ans_a, ans_b)
X = int(input())
for a in range(-201,201):
  for b in range(-201,201):
    if a**5 - b**5 == X:
      print(a,b)
      quit()
x = int(input())
for i in range(1, 10 ** 5):
    i5 = i ** 5
    flag = False
    for j in range(i):
        j5 = j ** 5
        if i5 + j5 == x:
            flag = True
            print(i, -j)
            break
        elif i5 - j5 == x:
            flag = True
            print(i, j)
    if flag:
        break
def main():
    D = int(input())
    flag = False
    for a in range(-128, 128):
        for b in range(-128, 128):
            if a ** 5 - b ** 5 == D:
                print(a, b)
                return
        
if __name__ == '__main__':
    main()
def main():
    x = int(input())

    num = 10**3
    for a in range(-num,num):
        for b in range(-num, num):
            if a**5-b**5 == x:
                print(a,b)
                return


if __name__ == '__main__':
    main()
x = int(input())
if x == 2:
    print(1, -1)
    exit(0)
for d in range(1, int(x ** 0.5) + 1):
    for w in [-d, -x // d, d, x // d]:
        for a in range(-1000, 1000):
            if a ** 5 - (a - w) ** 5 == x:
                print(a, a - w)
                exit(0)
"""
aを10^3くらいまででいいよね
"""
# print(19**5-10**5)
x = int(input())
# a>0 b>0のとき
for i in range(10**3):
    for j in range(i+1,10**3):
        if j ** 5 - i ** 5 == x:
            print(j,i)
            exit()
# a>0, b<0のとき
for i in range(10**3):
    for j in range(10**3):
        if i**5 + j**5 == x:
            print(i,-j)
            exit()
from sys import stdin
def main():
    #入力
    readline=stdin.readline
    x=int(readline())
    flag=False
    for A in range(-200,201):
        for B in range(-200,201):
            if A**5-B**5==x:
                print(A,B)
                flag=True
        if flag:
            break

if __name__=="__main__":
    main()
M=120

X=int(input())

for a in range(-M,M+1):
    for b in range(-M,M+1):
        if a**5-b**5==X:
            A,B=a,b
            break

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

for a in range(201):
  for b in range(-200,201):
    if a**5-b**5==x:
      print(a,b)
      exit()
import math

x = int(input())

f = False
for a in range(-200,200):
    for b in range(-200, 200):
        if a ** 5 - b ** 5 == x:
            print(a, b)
            f = True
            break
    if f == True:
        break
import sys
X = int(input())
for i in range(-1000,1000):
    for j in range(-1000,1000):
        if i**5 - j**5 == X:
            print(i,j)
            sys.exit()
X = int(input())

for a in range(-200, 200):
    for b in range(-200, 200):
        if a ** 5 - b ** 5 == X:
            print(a, b)
            exit()
x=int(input())
import math
x5=math.ceil(x**0.2)
#print(x5)
import numpy as np 
while(True):
    for ii in np.arange(x5,-1,-1):
        for jj in range(x5+1):
            #print("a,b",ii,jj)
            if ii**5-jj**5==x:
                print(ii,jj)
                exit()
            if ii**5+jj**5==x:
                print(ii,-jj)
                exit()
    x5*=2
x = int(input())
flag =1
for a in range(-255,255):
  if flag ==0:
    break
  for b in range(-255,255):
    if a**5 -b**5 == x:
      print(a,b)
      flag =0
      break
X = int(input())
flag = 0

for a in range(-1000, 1000):
    for b in range(-1000, 1000):
        if a**5 - b**5 == X:
            print(a, b)
            flag = 1
            break
    if flag == 1:
        break
# 解説を参考に作成

def solve():
    X = int(input())
    A, B = 0, 0
    for a in range(-200, 200):
        for b in range(-200, 200):
            if a ** 5 - b ** 5 == X:
                A, B = a, b
                break
    print(A, B)



if __name__ == '__main__':
    solve()
X =int(input())
b =False
for x in range(-1000,1000):
    for y in range(-1000,1000):
        if (x**5)-(y**5)==X:
            print(x,y)
            b=True
    if b==True:
        break
x = int(input())
for i in range(-1000, 1000):
    for j in range(-1000, 1000):
        if i**5 - j**5 == x:
            print(str(i) + " " + str(j))
            exit()
X = int(input())
fif = [i**5 for i in range(200)]
for i in range(len(fif)):
    B5 = fif[i] - X
    if abs(B5) in fif:
        index = fif.index(abs(B5))
        B = B5//abs(B5) * index
        break

print(i, B)
import sys
sys.setrecursionlimit(10**9)
X = int(input())
for i in range(-300, 300):
    for j in range(-300, 300):
        if i**5 - j**5 == X:
            print(i, j)
            sys.exit()
def solve():
    x = int(input())

    for a in range(-118, 120):
        for b in range(-119, 119):
            if a**5 - b**5 == x:
                return a, b





print(*solve())
x = int(input())

for i in range(-1000, 1000):
    for j in range(-1000, 1000):
        if i ** 5 - j ** 5 == x:
            print(i, j)
            exit()
from itertools import count

def main():
    X = int(input())
    for i in count():
        for A in (-i, i):
            for B in range(-i, i+1):
                if A**5 - B**5 == X:
                    print(A, B)
                    return


main()
dat = {}

for i in range(0, 500):
	for j in range(0, 500):
		res = i ** 5 - j ** 5
		dat[res] = [i, j]
		res = i ** 5 + j ** 5
		dat[res] = [i, -j]

tmp = int(input())
if tmp in dat:
	print(dat[tmp][0], dat[tmp][1])
from decimal import Decimal

x = int(input())
cnt = 0

while True:
    a = cnt ** 5
    if a < x:
        a = x - a
        z = -1
    else:
        a -= x
        z = 1

    a = Decimal(a) ** Decimal("0.2")
    if a % 1 == 0:
        print(cnt, int(a * z))
        break

    cnt += 1
X=int(input())
MAX=2*int(X**(1/5))+1
MIN=-2*int(X**(1/5))-1
for A in range(MIN,MAX):
    for B in range(MIN,MAX):
        if A**5-B**5==X:
            print(A,B)
            exit()
x = int(input())
d = {}
for i in range(1000):
  b = (-1000+i)**5
  d[b] = -1000+i
for i in range(1000):
  a = i**5
  d[a] = i
  if a-x in d:
    b = d[a-x]
    a = i
    break
print(a,b)
x = int(input())
import math
f = 1
for A in range(-10**5,10**5):
    A5 = A ** 5
    if x - A5 > 0:
        f = -1
        B = round(math.pow(x - A5,1/5),0)
    else:
        B = round(math.pow(-(x - A5),1/5),0)
    if  A5 == x + int(B*f) ** 5:
        print(A,int(B)*f)
        quit()
X = int(input())
A = 1
while True:
    if X > A ** 5:
        S = X - A ** 5
        B = S ** (1 / 5) * (-1)
    else:
        S = A ** 5 - X
        B = S ** (1 / 5)
    if A ** 5 - int(B) ** 5 == X:
        break
    A += 1
print(A, int(B))
X = int(input())
for A in range(-1000, 1000):
    for B in range(-1000, 1000):
        if(A**5 - B**5 == X):
            print(A, B)
            exit(0)
x = int(input())
a,b = 0,0

for i in range(-100,300):
    for j in range(-100,300):
        if i**5-j**5==x:
            a,b = i,j
            break

print(a,b)
flag = 0
X = int(input())
for A in range(1000):
    if flag!=0:
        break
    for B in range(1000):
        if A**5 - B**5 == X:
            print(str(A) + " " + str(B))
            flag=1
            break
        elif A**5 + B**5 == X:
            print(str(A) + " " + str(-B))
            flag=1
            break
import itertools
import math
X=int(input())
arr=[]
arr2=[]
arr3=[]
for i in range(0,640):
    arr.append(i**5)
    arr.append(-i**5)
l=itertools.combinations_with_replacement(arr,2)
for i in l:
    arr2.append(i[0]-i[1])
    arr3.append([i[0],i[1]])
ans=arr3[arr2.index(X)]
print(int(math.pow(abs(ans[0]), 1/5))*(1 if ans[0]>=0 else -1), int(math.pow(abs(ans[1]), 1/5))*(1 if ans[1]>=0 else -1))
def main():
    x = int(input())
    for i in range(200):
        for j in range(-200, 200):
            if i**5-j**5==x:
                print(i, j)
                return
 
 
if __name__ == "__main__":
    main()
N=int(input())
for i in range(-200,200):
    for j in range(-200,200):
        if i**5-j**5==N:
            a=i
            b=j
print(a,b)
x = int(input())
for a in range(-118,119):
    for b in range(-119,118):
        if a**5 - b**5 == x:
            print(a,b)
            exit()
import sys
x = int(input())
l = range(201)
for i in l:
  for j in l:
    if i**5+j**5 == x:
      print(' '.join([str(i),str(-j)]))
      sys.exit()
    elif i**5-j**5 == x:
      print(' '.join([str(i),str(j)]))
      sys.exit()
    else:
      pass
x=int(input())
for i in range(-120,121):
  for j in range(-120,121):
    if pow(i,5)-pow(j,5)==x:
      print(i,j);exit()
def main():
    X = int(input())
    for A in range(0, 201):
        for B in range(-201, 201):
            if pow(A, 5) - pow(B, 5) == X:
                print(A, B)
                return

if __name__ == "__main__":
    main()
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    flag=False
    x=int(input())
    for i in range(-200,200):
        for j in range(-200,200):
            if i**5-j**5==x:
                flag=True
                print(i,j)
                break
        if flag:
            break
resolve()
x=int(input())
for i in range(-118,120):
    for j in range(-118,120):
        if i**5-j**5==x:
            print(i,j)
            break
    else:
        continue
    break
x = int(input())

for i in range(-1000,1000):
    for j in range(-1000,1000):
        if i ** 5 - j ** 5 == x:
            print(i,j)
            quit()
X = int(input())

for i in range(-200, 201, 1):
    for j in range(-200, 201, 1):
        if i**5 - j**5 == X:
            print(i, j)
            exit(0)
x = int(input())
for i in range(300):
  for j in range(-300,300):
    if i >= j:
      a = i**5 - j**5
      if a == x:
        b = i
        c = j
print(b, c)
x = int(input())
for i in range(-119, 120):
  for j in range(-119, 120):
    if i**5 - j**5 == x:
      print(i,j)
      exit()
x = int(input())

for a in range(-118, 120):
    for b in range(-119, 119):
        if a**5 - b**5 == x:
            print(a, b)
            exit()
x=int(input())
for a in range(120):
 for b in range(-99,a):
  if a**5-b**5==x:print(a,b);exit()
X = int(input())

M = 21148

ns = [i**5 for i in range(M)]
n5s = {i**5:i for i in range(M)}

result = None
for i in range(M):
    b = ns[i]
    if b + X in n5s:
        result = n5s[b + X], i
    if X - b in n5s:
        result = i, -n5s[X - b]

print(*result)
x = int(input())
def function(a,b):
    return a**5-b**5

a = 0
for i in range(-119,119):
    for j in range(i+1,120):
        if function(j,i)==x:
            print(j,i)
            a = 1
            break
    if a == 1:
        break
x=int(input())
c=0
for i in range(-130,130):
    if c==1:
        break
    for j in range(-130,130):
        if i**5-j**5==x:
            print(i,j)
            c=1
            break
X = int(input())

for A in range(1000):
    for B in range(-1000, 1000):
        if A**5 - B**5 == X:
            print(A, B)
            break
    else:
        continue
    break
x=int(input())
for a in range(-120,121):
  for b in range(-120,121):
    if a**5-b**5==x:
      print(a,b)
      exit()
X = int(input())
k = list(range(0,100000))
k5 = []
for i in k:
    k5.append(i**5)
for j in k5:
    if X + j in k5:
        print(k[k5.index(X+j)],k[k5.index(j)])
        exit()
    elif X - j in k5:
        print(k[k5.index(X-j)],-k[k5.index(j)])
        exit()
X = int( input() )
 
A = 0
B = 0
for i in range(-900, 900):
  for j in range( -900, 900 ):
    if i**5 - j ** 5 == X:
      A = i
      B = j
print( A, B )
X=int(input())
sig=[[1,1],[1,-1],[-1,1],[-1,-1]]
f=False
for i in range(200):
    for j in range(200):
        for s in sig:
            A=s[0]*i
            B=s[1]*j
            if A**5-B**5==X:
                f=True
                break
        if f:
            break
    if f:
        break
print(A,B)
x=int(input())

for a in range(120):
    for b in range(-120,120):
        if x==a**5-b**5:
            print(a,b)
            exit()
x = int(input())

a=b=0

n=200

for a in range(-n,n):
	for b in range(-n,n):
		if a**5 - b**5 == x:
			print(a,b)
			exit(0)
x=int(input())


for a in range(-200,200):
    for b in range(-200,200):
        if x == a**5-b**5:
            ans = [a,b]
            print(a,b)
            exit()
'''
A = 500 とする。
このとき、X = 10^9 となるのは、 B = 499.9968... のとき。
→ AまたはB (の絶対値) が大きすぎると、Xが10^9に収まらない。

A, Bの探索範囲は -120~120で十分。
'''

from itertools import product

def main():
    X = int(input())
    for A, B in product(range(-150, 150), range(-150, 150)):
        if A**5 - B**5 == X:
            print(A, B)
            return

main()
x = int(input())
n = 120
for i in range(n):
  for j in range(i):
    if x == i**5-j**5:
      print(i,j)
      exit(0)
    if x == i**5+j**5:
      print(i,-j)
      exit(0)
X = int(input())
for A in range(-198,200):
    for B in range(-119,119):
        if pow(A,5) - pow(B,5) == X:
            print('{} {}'.format(A,B))
            exit()
x=int(input())
for a in range(-10**3,10**3):
    for b in range(-10**3,10**3):
        if a**5-b**5==x:
            print(a,b)
            exit()
X = int(input())

n5 = {}
for i in range(100000):
    n5[i**5] = i    

for i in range(-1000000, 1000000):
    b = i ** 5 + X
    if b in n5:
        print(n5[b], i)
        break
x=int(input())

f=0
for i in range(1000):
  for j in range(-1000,1000):
    if (i**5-j**5)==x:
      print(i,j)
      f=1
  if f==1:
    break
X = int(input())

def solve():
    for A in range(-200, 201):
        for B in range(-200, 201):
            if (A**5)-(B**5)==X:
                print(A, B)
                return

solve()
X = int(input())

for i in range(100):
    for j in range(100):
        if i ** 5 + j ** 5 == X:
            print(i, -j)
            exit()
            
        if i ** 5 + j ** 5 > X:
            continue

for i in range(2000):
    for j in range(2000):
        if j ** 5 - i ** 5 == X:
            print(j, i)
            exit()
            
        if j ** 5 - i ** 5 > X:
            continue
x = int(input())

def ans():
    for a in range(-1000, 1000):
        for b in range(-1000, 1000):
            if a**5 - b**5 == x:
                return print(a, b)
            
ans()
x = int(input())

for i in range(-200,200):
    for j in range(-200,200):
        if i ** 5 - j ** 5 == x:
            print(i,j)
            quit()
from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque

x = int(stdin.readline().rstrip())

for i in range(-150,150):
    for j in range(-150,150):
        if i**5-j**5 == x: print(i,j); sys.exit()
from sys import exit
x = int(input())
for a in range(-200, 201):
	for b in range(-200, 201):
		if a**5 - b**5 == x:
			print(a, b)
			exit()
X = int(input())

running = True
for a in range(-1000, 1001):
    if not running:
        break
    for b in range(-1000, 1001):
        if a**5 - b**5 == X:
            print(a, b)
            running = False
            break
n=int(input())
x=0
while True:
    if (x+1)**5-x**5>10**9:
        x+=1
        break
    x+=1
for i in range(-x,x):
    for j in range(-x,x):
        if i**5-j**5==n:
            print(i,j)
            exit()
x = int(input())
for i in range(200):
    for j in range(i+1):
        if i**5 - j**5 ==x:
            print(i,j)
        elif i**5 + j**5 ==x:
            print(i,-j)
x = int(input())
l = []
d = {}
for i in range(1000):
  b = (-1000+i)**5
  d[b] = -1000+i
for i in range(1000):
  a = i**5
  d[a] = i
  if a-x in d:
    b = d[a-x]
    a = i
    break
print(a,b)
import numpy as np

x = int(input())
k = 0
A = 0
B = 0
for i in range(0, 1000):
    I = i**5
    j = I - x
    J = abs(j)
    k = 0
    while k <= J**(0.2):
        if k**5 == J:
            A = i
            B = k*(np.sign(j))
            break
        k += 1
print(str(A) + ' ' + str(B))
def solve(string):
    x = int(string)
    a = {i**5: i for i in range(-10000, 10000)}
    for i in range(-10000, 10000):
        if x + i ** 5 in a:
            return str(f"{a[x+i**5]} {i}")


if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))
import math

X=int(input())

root = math.floor(X**0.2)
half = root//2 - 5

while root > half:
    root2 = int((X-root**5)**0.2)
    if root**5 + root2**5 == X:
        print(int(root),-int(root2))
        exit()
    root -= 1

root = math.ceil(X**0.2)

while True:
    root2 = int((root**5-X)**0.2)
    if root**5 - root2**5 == X:
        print(int(root),int(root2))
        exit()
    root+=1
import math
x = int(input())
b = 0

"""
def calc(b, b5):
    a = (x+b5)**0.2

    if a.real.is_integer():
        print(int(a), b)
        exit()

while True:
    b5 = b ** 5
    calc(b, b5)
    if x-b5 >= 0:
        calc(-b, -b5)
    b += 1
    """

for i in range(-120,120):
    for j in range(-120,120):
        if i**5 - j**5 == x:
            print(i, j)
            exit()
import sys
x = int(input())

a = 0
while a < 1000:
  b = -1000
  while b < 1000:
    if a ** 5 - b ** 5 == x:
      print(a, b)
      sys.exit()
    b += 1
  a += 1