Problem:
 Score : 400 points    Problem Statement Give a pair of integers (A, B) such that A^5-B^5 = X .
It is guaranteed that there exists such a pair for the given integer X .      Constraints  1 \leq X \leq 10^9  X is an integer.  There exists a pair of integers (A, B) satisfying the condition in Problem Statement.         Input Input is given from Standard Input in the following format:  X       Output Print A and B , with space in between.
If there are multiple pairs of integers (A, B) satisfying the condition, you may print any of them.  A  B         Sample Input 1 33      Sample Output 1 2 -1  For A=2 and B=-1 , A^5-B^5 = 33 .       Sample Input 2 1      Sample Output 2 0 -1

Solution (Python):


import sys
sys.setrecursionlimit(300000)


def solve(X: int):
    a = 0
    b = 0
    while True:
        for x in [1, -1]:
            tmp = X + (x * b) ** 5
            if tmp < 0:
                continue
            t = int(tmp ** (1 / 5))
            if t ** 5 == tmp:
                print(t, x * b)
                return
        b += 1
    return

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  
    solve(X)

if __name__ == '__main__':
    main()

Solution (Python):
X = int(input())

L = []

for i in range(500000):
  t = pow(i, 5)
  L.append(t)
  if t >= X:
    k = i
    break

for i in range(len(L)):
  for j in range(len(L)):
    if L[i] - L[j] == X:
      print(i, j)
      exit()
    if L[i] + L[j] == X:
      print(i, -j)
      exit()

while True:
  t = L[-1]
  if t == X:
    print(k, 0)
    exit()
  for i in range(len(L)):
    if t - L[i] == X:
      print(k, i)
      exit()
    if t + L[i] == X:
      print(k, -i)
      exit()
  k += 1
  L.append(pow(k, 5))

Solution (Python):
import sys
x=int(input())
y=int(x**0.5)
for i in range(0,y):
    for j in range(-10**4,i):
        if i**5-j**5==x:
            print(i,j)
            sys.exit()
            break

Solution (Python):
X = int(input())

X_MAX = 1000000000

for A in range(1, X_MAX + 1):
    if (A + 1) ** 5 - A ** 5 > X: break

A_MAX = A

for A in range(1, A_MAX + 1):
    l = -A_MAX
    r = A_MAX
    while l < r:
        m = l + (r - l) // 2
        if m ** 5 == A ** 5 - X:
            l = r = m
            break
        elif m ** 5 < A ** 5 - X:
            l = m + 1
        else:
            r = m - 1
    
    B = l
    if A ** 5 - B ** 5 == X: break

print(A, B)

Solution (Python):
X = int(input())



for i in range(-150,151):
    for j in range(-150,151):
        if i ** 5 - j ** 5 == X:
            print("{} {}".format(i,j))
            exit()

Solution (Python):
mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

    x = int(input())

    num_list = []
    i = 0
    while True:
        num_list.append(i)
        if (i+1)**5 - i**5 > x:
            break
        i += 1

    L = len(num_list)
    for i in range(L):
        a = num_list[i]
        for j in range(L):
            b = num_list[j]
            if a ** 5 - b ** 5 == x:
                print(a, b)
                exit()
            if a ** 5 - (-b) ** 5 == x:
                print(a, -b)
                exit()
            if b ** 5 - a ** 5 == x:
                print(b, a)
                exit()
            if b ** 5 - (-a) ** 5 == x:
                print(b, -a)
                exit()


if __name__ == '__main__':
    main()

Solution (Python):
X = int(input())
A = -1000
B = -1000
ok = False


for i in range(200):
    for j in range(200):
        if i**5 - j**5 == X:
            A = i
            B = j
            ok = True
        elif i**5 + j**5 == X:
            A = i
            B = -j
            ok = True
        if ok:
            break
    if ok:
        break

print(A, B)

Solution (Python):
x = int(input())
flg = 0
ans1 = 0
ans2 = 0
for i in range(-200,200):
    for j in range(i,200):
        if j ** 5 + i ** 5 == x:
            flg = 1
            ans1 = j
            ans2 = -i

        elif j ** 5 - i ** 5 == x:
            flg = 1
            ans1 = j
            ans2 = i
        if flg:
            break
    if flg:
        break
print(ans1,ans2)

Solution (Python):
x = int(input())
done = False
for i in range(-200, 201):
    for j in range(-200, 201):
        if i**5 - j**5 == x:
            print(i, " ", j)
            done = True
        if done:
            break
    if done:
        break

Solution (Python):
X = int(input())

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

Solution (Python):
import sys

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)
            sys.exit()

Solution (Python):


r=[]
for i in range(230):
    A=i-125
    for j in range(230):
        B=j-125
        r.append((A**5-B**5,A,B))
r.sort()

target=int(input())
lwbd = 0
upbd = len(r)


while lwbd<=upbd:
    middle = lwbd + (upbd-lwbd)//2
    if(r[middle][0]==target):
        break
    elif r[middle][0]>target:
        upbd = middle -1
    else:
        lwbd = middle +1
print(r[middle][1],r[middle][2])

Solution (Python):
x = int(input())

for i in range(-500, 501):
	for j in range(-500, 501):
		if i ** 5 - j ** 5 == x:
			print(i, j)
			exit()

Solution (Python):
from sys import stdin
X = int(stdin.readline().rstrip())
for a in range(-500,501):
    for b in range(-500,501):
        if a**5 - b**5 == X:
          ans1 = a
          ans2 = b
print(ans1,ans2)

Solution (Python):
import sys
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()

Solution (Python):
X = int(input())
for a in range(10**3):
  for b in range(10**3):
    if a**5-b**5 == X:
      ans = [a, b]
      break
    if a**5+b**5 == X:
      ans = [a, -b]
      break
print(ans[0], ans[1])

Solution (Python):
x=int(input())
if x==0:
    print('0 0')
i=0
while True:
    flag=False
    a=pow(i,5)
    r=x-a
    if r<0:
        r*=-1
        flag=True
    j=1
    n=1
    while n<r:
        j+=1
        n=pow(j,5)
    if n==r and not flag:
        print(i,-1*j)
        break
    elif n==r and flag:
        print(i,j)
        break
    else:
        i+=1

Solution (Python):
x=int(input())
num=[]
for i in range(10001):
    num.append(i**5)

for j in range(10000):
    for k in range(j+1,10001):
        if num[k]-num[j]==x:
            print(k,j)
            exit()
        elif num[k]+num[j]==x:
            print(k,-1*j)
            exit()

Solution (Python):
n = int(input())
arr = []
for i in range(1,int(pow(n,1/2))+1):
  if n % i == 0:
    arr.append(i)
res = []
for i in range(len(arr)):
  for j in range(-arr[i]-1,int(pow(n,1/2)+1)):
    if (j + arr[i])**5 - j**5 == n:
      res = [j+arr[i],j]
      break
print(*res)

Solution (Python):

x = int(input())
for b in range(-(10 ** 4), 10 ** 4):
    ok = 0
    ng = 10 ** 6
    while ng - ok > 1:
        m = (ok + ng) // 2
        if m ** 5 - b ** 5 <= x:
            ok = m
        else:
            ng = m
    a = ok
    if a ** 5 - b ** 5 == x:
        print(a, b)
        exit()

Solution (Python):
X = int(input())
M = 10 ** 10

for i in range(1, M):
    A = i ** 5
    ok = 10 ** 5
    ng = -(10 ** 5)
    while ok - ng > 1:
        mid = (ok + ng) // 2
        if A - mid ** 5 <= X:
            ok = mid
        else:
            ng = mid
    if A - ok ** 5 == X:
        print(i, ok)
        break

Solution (Python):
X=int(input())
for i in range(120):
  for j in range(i+1):
    if i**5-j**5==X:
      print(i,j)
      break
      break
    if i**5+j**5==X:
      print(i,-j)
      break
      break

Solution (Python):

X = int(input())

Y = 1 
flg = 0

while flg==0:
  if X%Y==0 and (Y**4-X//Y)%5==0:
    Z1 = Y*Y
    Z0 = (Y**4-X//Y)//5
    A = 1
    B = A-Y
    while True:
      if (A*B)**2+Z1*A*B == -Z0:
        print(A,B)
        flg = 1
        break
      elif B>0 and (A*B)**2+Z1*A*B > -Z0:
        break
      A += 1
      B += 1
  Y += 1

Solution (Python):

import sys
sys.setrecursionlimit(10**8)
INF = float("inf")


def solve(X: int):

    
    upper = 160
    for a in range(-upper, upper+1):
        for b in range(-upper, upper+1):
            if X == a**5-b**5:
                print(a, b)
                return
    
    
    
    
    
    
                
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  
    solve(X)


if __name__ == '__main__':
    main()

Solution (Python):
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()

Solution (Python):



def main():
    X = int(input())
    

    for b in range(119):
        a = b+1
        
        while a**5 - b**5 < X:
            a += 1
        
        if a**5 - b**5 == X:
            print(a, b)
            exit()
    
    for b in range(-1, -120, -1):
        a = 0
        
        while a**5 - b**5 < X:
            a += 1
        
        if a**5 - b**5 == X:
            print(a, b)
            exit()


main()

Solution (Python):
x = int(input())
def fctr1(n): 
    f=[]
    c=0
    r=int(n**0.5)
    for i in range(2,r+2):
        while n%i==0:
            c+=1
            n=n//i
        if c!=0:
            f.append([i,c])
            c=0
    if n!=1:
        f.append([n,1])
    return f

def divisor(n):
    ass = []
    for i in range(1,int(n**0.5)+1):
        if n%i == 0:
            ass.append(i)
            if i**2 == n:
                continue
            ass.append(n//i)
    return ass 
def cal(a,b):
    return a-b
def cal1(a,b):
    return a**4 + a**3*b+a**2*b**2+a*b**3+b**4








k = []
for i in range(-200,200):
    for j in range(-200,200):
        if cal(i,j)*cal1(i,j) == x:
            print(i,j)
            exit()

Solution (Python):
X = int(input())
L = [0 for _ in range(201)]
for i in range(201):
    L[i] = i * i * i * i * i
flg = False
for i in range(201):
    for j in range(201):
        if L[i] - L[j] == X:
            print(i, j)
            flg = True
        elif L[i] + L[j] == X:
            print(i, -j)
            flg = True
        if flg:
            break
    if flg:
        break

Solution (Python):
x = int(input())

list = []
for i in range(-1000, 1001):
    list.append(i ** 5)


def solve():
    for i in range(1, 2001):
        for j in range(i):
            if list[i] - list[j] == x:
                return [i-1000, j-1000]

ans = solve()
print(*ans)

Solution (Python):
x = int(input())
a = [i ** 5 for i in range(120)]

for i in range(120):
    for j in range(i + 1, 120):
        if a[j] - a[i] == x:
            print(j, i)
            break
        elif a[j] + a[i] == x:
            print(j, -i)
            break

Solution (Python):
n=int(input())
for i in range(int(pow(n,1/5))+100):
	a=i
	b=-1*(n-pow(a,5))

	c=int(pow(abs(b),1/5))
	if b<0:
		c=-c
	if c*c*c*c*c==b:
		print(a,c)
		exit()

Solution (Python):
x = int(input())

fives = [i**5 for i in range(10**5)]

for a5 in fives:
    b5 = abs(a5 - x)
    if b5 in fives:
        idx_a = fives.index(a5)
        idx_b = fives.index(b5)
        if a5 - b5 == x:
            pass
        if a5 + b5 == x:
            idx_b = -idx_b
        ans = [idx_a, idx_b]
        break
print(ans[0], ans[1])

Solution (Python):
X = int(input())
A = -1
while True:
    A += 1
    if (A ** 5 - X) >= 0:
        temp_num = ((A ** 5 - X) ** (1/5)) // 1
        plus_minus = 1
    else:
        temp_num = ((X - A ** 5) ** (1/5)) // 1
        plus_minus = -1
    if A ** 5 -  (plus_minus * temp_num) ** 5 == X:
        B = plus_minus * temp_num
        break
    elif A ** 5 - (plus_minus * (temp_num + 1)) ** 5 == X:
        B = plus_minus * (temp_num + 1)
        break
print(A,int(B))

Solution (Python):
X=int(input())
dict=[]
for i in range(10000):
    for j in range(10000):
        if i**5-j**5==X:
            print(i,j)
            exit()
        if i**5+j**5==X:
            print(i,-1*j)
            exit()

Solution (Python):

def factorize(n):
    
    
    
    
    result = []
    tmp = n
    for k in range(2, int(n ** 0.5) + 1):
        cnt = 0
        while tmp % k == 0:
            cnt += 1
            tmp //= k
        if cnt > 0:
            result.append([k, cnt])
    if tmp != 1:
        result.append([tmp, 1])
    return result

def divisorize(n):
    
    
    
    f = factorize(n)
    divisors = [1]
    for k in range(len(f)):
        num_divisors = len(divisors)
        for i in range(1, f[k][1] + 1):
            for j in range(num_divisors):
                divisors.append(divisors[j] * f[k][0] ** i)
    return sorted(divisors)

x = int(input())
a = 0
d = divisorize(x)
flg = False
while True:
    for dd in d:
        b = a - dd

        try:
            if a ** 5 - b ** 5 == x:
                flg = True
                break
        except:
            pass
    if flg:
        break
    a += 1
print(a, b)

Solution (Python):
x=int(input())
for a in range(101):
    for b in range(101):
        if a**5+b**5==x:
            print(f"{a} {-b}")
            exit(0)
for a in range(201):
    for b in range(201):
        if a**5-b**5==x:
            print(f"{a} {b}")
            exit(0)

Solution (Python):
X = int(input())

cands = {}
for i in range(-200, 201):
    cands[i**5] = i

for a in range(1, 201):
    A = a ** 5
    B = A - X
    if B in cands:
        b = cands[B]
        print(a, b)
        quit()

Solution (Python):
import math
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
x=int(input())
l=make_divisors(x)
if x==0:
  answer=[0,0]
for i in range(math.ceil(2*pow(x,0.2))):
  for j in l:
    if pow(i,5)-pow(i-j,5)==x:
      answer=[i,i-j]
      break
print(answer[0],answer[1])

Solution (Python):
import itertools
x=int(input())
a=list(range(-1000,1000))
l=itertools.permutations(a, 2)
for i in l:
  if i[0]**5-i[1]**5==x:
    print(i[0],i[1])
    break

Solution (Python):
x=int(input())

a=[0]*1001

for i in range(1001):
    a[i]=i**5

for i in range(1001):
    for j in range(1001):
        if a[i]-a[j]==x:
            print(i,j)
            exit()
        elif a[i]+a[j]==x:
            if (-1*i)**5-j**5==x:
                print(-1*i,j)
                exit()
            elif i**5-(j*-1)**5==x:
                print(i,-1*j)
                exit()

Solution (Python):
import math
x = int(input())
for i in range(-1000,1001):
	for j in range(-1000,1001):
		a5 = pow(i , 5)
		b5 = pow(j, 5)
		if a5 - b5 == x:
			exit(print(i , j))

Solution (Python):
x = int(input())

ok = False
for a in range(121):
    for b in range(-120, 121):
        if a**5 - b**5 == x:
            print("%d %d" % (a, b))
            ok = True
        if ok:
            break
    if ok:
        break

Solution (Python):
x=int(input())

dic={}



a=set([])
for i in range(1000):
    a.add(i**5)
    dic[i**5]=i
    a.add(-1*i**5)
    dic[-1*i**5]=i*(-1)



for item1 in a:
    for item2 in a:
        if item1 - item2==x:
            print(dic[item1],dic[item2])
            exit()

Solution (Python):

import math
X = int(input())

B = -math.floor(math.pow(X, 0.2))
for b in range(B, 100000):
    tmp = math.pow(X + b ** 5, 0.2)
    if math.floor(math.floor(tmp+1.0e-6) - tmp + 1.0e-6) == 0:
        break
        
tmp = math.floor(tmp + 1.0e-6)
print(tmp, b)

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
INF = 10**10
MOD = 10**9 + 7
X = int(input())
for i in range(1000):
    for j in range(-1000,1000):
        
        if i**5 - j**5 == X:
            print (i,j)
            exit()

Solution (Python):
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)

Solution (Python):


import sys
stdin = sys.stdin

def ns(): return stdin.readline().rstrip()
def ni(): return int(ns())
def na(): return list(map(int, stdin.readline().split()))



def main():
    x = ni()
    for a in range(-1000,1000):
        for b in range(-1000, 1000):
            if a**5 - b**5 == x:
                print("{} {}".format(a, b))
                quit()


if __name__ == "__main__":
    main()

Solution (Python):
x=int(input())
dic={}
for i in range(10**5):
  dic[i**5]=i
  dic[(-i)**5]=-i
for i in range(10**5):
    if i**5+x in dic:
      print(dic[i**5+x],i)
      break
    if (-i)**5+x in dic:
      print(dic[(-i)**5+x],-i)
      break

Solution (Python):
n=int(input())
A=[i**5 for i in range(10000)]
B=[i**5 for i in range(10000)]

for i in A:
    for j in B:
        if i-j==n:
            print(int(i**(1/5)),int(j**(1/5)))
            exit()
        if i+j==n:
            print(int(i**(1/5)),int(-j**(1/5)))
            exit()

Solution (Python):
MAX = 1000


def getAgenerator():
    for i in range(MAX):
        yield i


def getBgenerator():
    for j in range(MAX):
        yield j
        yield j * -1


X = int(input())

for a in getAgenerator():
    for b in getBgenerator():
        if a ** 5 - b ** 5 == X:
            print("{} {}".format(a, b))
            exit()

Solution (Python):
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

d = make_divisors(x)
for i in d:
    for a in range(1, 10000):
        b = a-i
        if a**5-b**5 == x:
            print(a, b)
            exit()

Solution (Python):
def get_divisor(n: int) -> list:
    divisor = []
    for i in range(1, n + 1):
        if i * i > n:
            break
        if n % i == 0:
            divisor.append(i)
            if n // i != i:
                divisor.append(n // i)
    
    return divisor


x = int(input())
cand = get_divisor(x)

for d in cand:
    if d**5 == x:
        print(d, 0)
    elif d**5 < x:
        a = d
        b = 0
        while a**5 - b**5 < x:
            a += 1
            b += 1
        if a**5 - b**5 == x:
            print(a, b)
            break

        a = 0
        b = -d
        while a**5 - b**5 < x:
            a -= 1
            b -= 1
        if a**5 - b**5 == x:
            print(a, b)
            break
    else:
        if d % 2 == 0 and (d // 2)**5 + (d // 2)**5 > x:
            continue
        if d % 2 == 1 and ((d + 1) // 2)**5 + (d // 2)**5 > x:
            continue
        a = d
        b = 0
        while a**5 - b**5 > x:
            a -= 1
            b -= 1
            
        if a**5 - b**5 == x:
            print(a, b)
            break

        a = 0
        b = -d
        while a**5 - b**5 > x:
            a += 1
            b += 1
        if a**5 - b**5 == x:
            print(a, b)
            break

Solution (Python):
X = int(input())

for i in range(1000):
    for j in range(1000):
        if i ** 5 - j ** 5 == X:
            result = [i, j]
        if i ** 5 - (-j) ** 5 == X:
            result = [i, -j]

print(*result)

Solution (Python):
X = int(input())
F = [0, 1]
i = 2
while F[-1] - F[-2] <= X:
    F += [i**5]
    i += 1
A, B = -1, -1
flag = False
for i in range(0, len(F)):
    for j in range(0, len(F)):
        if F[i] - F[j] == X:
            flag = True
            A = i
            B = j
            break
        elif F[i] + F[j] == X:
            flag = True
            A = i
            B = -j
            break
    if flag:
        break

print(A, B)

Solution (Python):
X = int(input())

FIVES = [x ** 5 for x in range(200)]

for ki,vi in enumerate(FIVES):
    for kj,vj in enumerate(FIVES):
        if vi - vj == X:
            print(ki,kj)
            exit()
        if vj - vi == X:
            print(kj,ki)
            exit()
        if vi + vj == X:
            print(ki,-kj)
            exit()

Solution (Python):
import sys
readline = sys.stdin.readline

X = int(readline())

for a in range(1, 200):
    for b in range(-200, a):
        if a**5 - b**5 == X:
            print(a, b)
            exit(0)

Solution (Python):

import math
X = int(input())

flag = False
for a in range(5000):
    
    for b in range(5000):
        if a**5 + b**5 == X:
            print(a,-b)
            flag = True
            break
            
        elif a**5 - b**5 == X:
            print(a,b)
            flag = True
            break
            
    if flag:
        break

Solution (Python):
X=int(input())
n5=[n**5 for n in range(1000)]
for i,a in enumerate(n5):
    for j,b in enumerate(n5):
        if a-b==X: print(i,j); exit()
        elif a+b==X: print(i,-j); exit()
        elif -a-b==X: print(-i,j); exit()
        elif -a+b==X: print(-i,-j); exit()

Solution (Python):
X = int(input())

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

Solution (Python):
import sys
from math import log2,floor,ceil,sqrt



Ri = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()
 
def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
INF = 10 ** 18
MOD = 10**9+7

n = int(ri())
s  = set([i**5 for i in range(1001)])
f,l = -1,-1
sign = 1
for i in s:
    if n+i in s:
        f = i
        l = n+i
        break
    if n-i in s:
        sign = -1
        f = i
        l = n-i
        break
print(int(pow(l,1/5)),int(sign*pow(f,1/5)))

Solution (Python):
x = int(input())

l = []
for i in range(400):
    l.append((i + 1 - 200) ** 5)

for i in range(400):
    for j in range(400):
        if ((i + 1 - 200) ** 5 - (j + 1 - 200) ** 5 == x):
            print ("%s %s" % ((i + 1 - 200), (j + 1 - 200)))
            exit (0)

Solution (Python):
x = int(input())
def main():
    for a in range(-1000,1001):
        for b in range(-1000,1001):
            if a**5-b**5==x:
                print("{} {}".format(a,b))
                import sys
                sys.exit()

main()

Solution (Python):
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()

Solution (Python):
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)

    divisors.sort()
    return divisors
num = make_divisors(x)
n = len(num)
for i in range(n):
    p = num[i]
    q = x//num[i]
    for b in range(-150,150):
        a = b+p
        if a**4 + (a**3)*b + (a*b)**2 + a*(b**3) + b**4 == q:
            print(a,b)
            break

Solution (Python):
from sys import stdin
input = stdin.readline

n = int(input())
flag = 0
a = []

for x in range(201):
    a.append(x ** 5)

for x in range(201):
    for y in range(201):
        if a[x] - a[y] == n:
            print(x, y)
            flag = 1
            break
        if a[x] + a[y] == n:
            print(x, -y)
            flag = 1
            break
        if -a[x] - a[y] == n:
            print(-x, y)
            flag = 1
            break
        if -a[x] + a[y] == n:
            print(-x, -y)
            flag = 1
            break

    if flag == 1:
        break

Solution (Python):
import itertools
X = int(input().strip())

data = {}
for v in range(-200, 200):
    data[v] = pow(v, 5)

for a, b in itertools.product(data.items(), data.items()):
    if a[1] - b[1] == X:
        print(a[0], b[0])
        break

Solution (Python):
x = int(input())
import sys


l = list(range(-200, 200))
      

for A in l:
  for B in l:
    if pow(A,5) - pow(B,5) == x:
      print(A,B)
      sys.exit()

Solution (Python):
import sys
X=int(input())

for b in range(-2*10**3,2*10**3+1):
  for a in range(-2*10**3,2*10**3+1):
    if a**5-b**5==X:
      print(a,b)
      sys.exit(0)

Solution (Python):

import sys
from collections import Counter
from itertools import permutations, combinations

from math import gcd
from math import ceil, floor
import bisect
sys.setrecursionlimit(10 ** 6)
inf = float("inf")

def input():
    return sys.stdin.readline()[:-1]

def main():
    x = int(input())
    for a in range(1000):
        for b in range(1000):
            if a**5 - b**5 == x:
                print(a, b)
                exit()
            elif a**5 + b**5 == x:
                print(a, -b)
                exit()
            else:
                continue

if __name__ == '__main__':
    main()

Solution (Python):
X=int(input())

judge=False

for i in range(-1000,1001):
    for j in range(-1000,1001):
        if pow(i,5)-pow(j,5)==X:
            print(i,j)
            judge=True
            break
    if judge:
        break

Solution (Python):
x = int(input())
for i in range(-200,200):
    for j in range(-200,200):
        if i**5-j**5==x:
            print(i,j)
            break
    else:
        continue
    break

Solution (Python):
x = int(input())
flag = 0

for i in range(-1000, 1000):
    if flag == 1:
        break
    for j in range(-1000, 1000):
        if x + j ** 5 == i ** 5:
            flag = 1
            print(str(i) + " " + str(j))
            break

Solution (Python):
x = int(input())
a=0
b=0

for i in range(1001):
  for j in range(-1000,1001,1):
    if i**5-j**5 ==x:
      a = i
      b = j
      break
print(a,b)

Solution (Python):

import re
import math
from collections import defaultdict
import itertools
from copy import deepcopy
import random
from heapq import heappop,heappush
import time
import os
import queue
import sys
import datetime
from functools import lru_cache

readline=sys.stdin.readline
sys.setrecursionlimit(2000000)

alphabet="abcdefghijklmnopqrstuvwxyz"
mod=int(10**9+7)
inf=int(10**20)
def yn(b):
    if b:
        print("yes")
    else:
        print("no")
def Yn(b):
    if b:
        print("Yes")
    else:
        print("No")
def YN(b):
    if b:
        print("YES")
    else:
        print("NO")
class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def is_power(a,b):
    now=b
    while now<a:
        now*=b
    if now==a:return True
    else:return False
def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def get_facs(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
def get_primes(n,type="int"):
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    if(type=="bool"):return A
    B=[]
    for a in range(n+1):
        if(A[a]):B.append(a)
    return B
def is_prime(num):
    if(num<=2):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def ifelse(a,b,c):
    if a:return b
    else:return  c
def join(A,c=" "):
    n=len(A)
    A=list(map(str,A))
    s=""
    for a in range(n):
        s+=A[a]
        if(a<n-1):s+=c
    return s
def factorize(n,type_="dict"):
    b = 2
    list_ = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            list_.append(b)
        b+=1
    if n > 1:list_.append(n)
    if type_=="dict":
        dic={}
        for a in list_:
            if a in dic:
                dic[a]+=1
            else:
                dic[a]=1
        return dic
    elif type_=="list":
        return list_
    else:
        return None
def floor_(n,x=1):
    return x*(n//x)
def ceil_(n,x=1):
    return x*((n+x-1)//x)
def hani(x,min_,max_):
    ret=x
    if x<min_:ret=min_
    if x>max_:ret=max_
    return ret
def seifu(x):
    return x//abs(x)

def f():
    return
def main():
    x=int(input())
    n=600
    for a in range(-n,n):
        for b in range(-n,n):
            if a**5-b**5==x:
                print(a,b)
                return
main()

Solution (Python):
x=int(input())

answer=0

for i in range(240):
    for j in range(240):
        p=i-120
        q=j-120
        if p**5-q**5==x:
            answer=(p, q)

print(answer[0], answer[1])

Solution (Python):
def solve():
    X = int(input())
    for A in range(-1000,1000):
        for B in range(-1000,1000):
            if pow(A,5) - pow(B,5) == X:
                print(A,B)
                return

if __name__ == '__main__':
    solve()

Solution (Python):
X = int(input())
cand = [(i**5, i) for i in range(-119, 120)]
for i5a, ia in cand:
    for i5b, ib in cand:
        if i5a - i5b == X:
            print(ia, ib)
            exit()

Solution (Python):
X = int(input())
A = [0] * 201
flag = True
for i in range(200):
    A[i] = i ** 5
for i in range(200):
    if(flag == False):
        break
    for i2 in range(i):
        if abs(X - A[i]) == A[i2]:
            if X - A[i] >= 0:
                print(str(i) + " "+ str(-1 * i2))
            else:
                print(str(i) + " "+ str(i2))
            flag = False
            break

Solution (Python):
x=int(input())
p=0
q=0
flag=True
for a in range(1000):
    if flag:
        B=abs(a**5-x)
        for i in range(int(B**(0.2))+1):
            if i**5==B:
                q=i
                p=a
                flag=False
                break
for a,b in [(p,q),(-p,q),(p,-q),(-p,-q),(q,p),(-q,p),(q,-p),(-q,-p)]:
    if a**5-b**5==x:
        print(a,b)
        break

Solution (Python):
five_powers = []
x = 0
while x < 10 ** 3:
    five_powers.append(x)
    x += 1
x = int(input())
n = len(five_powers)
flag = False
for i in range(n):
    for j in range(n):
        a = five_powers[i]
        b = five_powers[j]
        if a ** 5 - b ** 5 == x:
            print('{} {}'.format(a, b))
            flag = True
            break
        if a ** 5 + b ** 5 == x:
            print('{} {}'.format(a, -1 * b))
            flag = True
            break
    if flag: break

Solution (Python):
"""
aを10^3くらいまででいいよね
"""

x = int(input())

for i in range(10**3):
    for j in range(i+1,10**3):
        if j ** 5 - i ** 5 == x:
            print(j,i)
            exit()

for i in range(10**3):
    for j in range(10**3):
        if i**5 + j**5 == x:
            print(i,-j)
            exit()