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):
x=int(input())
i=1
a=0
b=0
while(a==0 and b==0):
  for j in range(-i,i):
    if i**5-j**5==x:
      a=i
      b=j
  i+=1
    
print(a,b)

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

for a in range(10**3):
  for b in range(10**3):
    frag = False
    if a ** 5 - b ** 5 == x:
      print(a,b)
      frag = True
      break
    elif (-a) ** 5 - b ** 5 == x:
      print(-a,b)
      frag = True
      break
      
    elif a ** 5 - (-b) ** 5 == x:
      print(a,-b)
      frag = True
      break
      
    elif (-a) ** 5 - (-b) ** 5 == x:
      print(-a,-b)
      frag = True
      break
  if frag == True:
      break

Solution (Python):
x=int(input())
if x==1:
    print(0,-1)
    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)
    return divisors
li=sorted(make_divisors(x))
for i in range(len(li)):
    j=li[i]
    k=j//2
    while pow(k,5)-pow(k-j,5)<=x:
        if pow(k,5)-pow(k-j,5)==x:
            print(k,k-j)
            exit()
        else:
            k+=1
    continue

Solution (Python):
X = int(input())
for i in range(-500, 500):
    for j in range(-500, 500):
        if i**5 - j**5 == X:            
            ans = [str(i), str(j)]
            break
print(" ".join(ans))

Solution (Python):
X = int(input())
Ans = []
for A in range(201):
  for B in range(A):
    if A ** 5 - B ** 5 == X:
      Ans = [A, B]
    if A ** 5 + B ** 5 == X:
      Ans = [A, B * (-1)]
      break
      
print(Ans[0], Ans[1])

Solution (Python):
X = int(input())
a = 1
b = 0
while True:
    tmp = a**5-b**5
    if tmp < X:
        b -= 1
    elif tmp == X:
        print(a,b)
        break
    else:
        b = a
        a += 1

Solution (Python):
def f(a, b):
    return a**4 + a**3 * b + a**2 * b**2 + a * b**3 + b**4


x = int(input())
pair = [(1, x)]
i = 2
while i*i <= x:
    if x % i == 0:
        pair.append((i, x//i))
    i += 1

for i, j in pair:
    
    a = 0
    b = -i
    while b <= 0 or f(a, b) <= j:
        
        a += 1
        b += 1
        if f(a, b) == j:
            print(f"{a} {b}")
            exit(0)

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

x = int(pow(X, 0.2) // 1)
y1 = x - pow(10, 6)
y2 = x + pow(10, 6)


for B in range(y1, y2 + 1):
  A = pow(X + pow(B, 5), 0.2) 
  
  if type(A) != complex:
    if abs(int(A) - A) < pow(10, -6):
      print(int(A), B)
      quit()

Solution (Python):
from math import floor
from copy import deepcopy

def calc(a,b):
  ret=a**4+b**4+a*b*(a**2+a*b+b**2)
  return ret

X=int(input())
p=floor(X**0.5)

q=[]
for i in range(1,p+1):
  if X%i==0:
    q.append([i,X//i])
    
for kumi in q:
  s=kumi[0]
  t=kumi[1]
  
  for A in range(p):
    B=A-s
    if calc(A,B)==t:
      print(A,B)
      break

Solution (Python):
def main():
    x = int(input())
    n5 = {i:i**5 for i in range(-130, 131)}
    for i, v1 in n5.items():
        for j, v2 in n5.items():
            if v1 - v2 == x:
                print(i, j)
                return

if __name__ == "__main__":
    main()

Solution (Python):
import sys
X=int(input())
for i in range(500):
  for j in range(500):
    if (i-100)**5-(j-100)**5==X:
      A=[]
      A.append(i-100)
      A.append(j-100)
      A=[str(n) for n in A]
      print(' '.join(A))
      sys.exit()

Solution (Python):
X = int(input())
s = [0] * 200
for i in range(200):
    s[i] = i**5
k = 0
for i in range(200):
    if k == 1:
        break
    else:
        for j in range(200):
            if k == 1:
                break
            else:
                if s[i] - s[j] == X:
                    print(i,j)
                    k = 1
                elif s[j] - s[i] == X:
                    print(j,i)
                    k = 1
                elif s[i] + s[j] == X:
                    print(i,-j)
                    k = 1
                elif s[i] + s[j] == -X:
                    print(-i,j)
                    k = 1

Solution (Python):
x=int(input())
m=10**3
for i in range(0,m):
    for j in range(-m,i):
        if i**5-j**5 == x:
            ans1=i
            ans2=j

print(ans1,ans2)

Solution (Python):
X = int(input())
for a in range(-300, 300):
    for b in range(-300, 300):
        if a**5 - b**5 == X:
            print(a, b)
            exit()

Solution (Python):
t=0
n=int(input())
for i in range(-1000,1000):
    for j in range(-1000,1000):
        if i**5-j**5==n:
            print(i,j,sep=' ')
            t=1
            break
    if t==1:
        break

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

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

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

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

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

lis = set([])
lis.add(0)
for i in range(1, 250):
    lis.add(i**5)

for x in lis:
    if abs(X-x) in lis:
        if x-X<0:
            print(int(x**0.2), -int(abs(x-X)**0.2))
        else:
            print(int(x**0.2), int(abs(x-X)**0.2))
        break

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

pos_array = []
neg_array = []

idx = 0
num = 0
while num < 10**15:
    num = pow(idx, 5)
    pos_array.append(num)
    idx += 1

idx = 0
num = 0
while num > -10**15 - 1:
    num = pow(idx, 5)
    neg_array.append(num)
    idx -= 1

for i in range(len(pos_array)):
    for j in range(len(pos_array)):
        if pos_array[i] - pos_array[j] == x:
            print("%d %d" % (i, j))
            exit(0)

for i in range(len(pos_array)):
    for j in range(len(neg_array) - 1, -1, -1):
        if pos_array[i] - neg_array[j] == x:
            print("%d %d" % (i, -j))
            exit(0)

Solution (Python):
x = int(input())
a = 1
true = True
while true:
    if a**5-x < 0:
        b = -1*int((-1*(a**5-x))**(1/5))
    else:
        b = int((a**5-x)**(1/5))
    if a**5 -b**5 == x:
        true = False
        break
    a += 1
    
print(a ,b)

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


def solve(a, b, c):
  D = (b**2 - 4*a*c) ** (1/2)
  x_1 = (-b + D) / (2 * a)
  x_2 = (-b - D) / (2 * a)
  return x_1, x_2

for pattern in make_divisors(X):
  diff = pattern
  A = 5
  B = 5 * (diff ** 2)
  C = diff ** 4 - X//diff
  sekiss = solve(A, B, C)
  for sekis in sekiss:
    if sekis == int(sekis):
      
      kouhos = solve(1, -diff, -int(sekis))
      if kouhos[0].imag == 0.0:
        print(int(kouhos[0]), int(kouhos[0] - diff))
      break

Solution (Python):
import sys
import math
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
from collections import deque
def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def S(): return sys.stdin.readline().rstrip()
def LS(): return sys.stdin.readline().split()
def LS2(N): return [sys.stdin.readline().split() for i in range(N)]
def FILL(i,h): return [i for j in range(h)]
def FILL2(i,h,w): return [FILL(i,w) for j in range(h)]
def FILL3(i,h,w,d): return [FILL2(i,w,d) for j in range(h)]
def FILL4(i,h,w,d,d2): return [FILL3(i,w,d,d2) for j in range(h)]
def sisha(num,digit): return Decimal(str(num)).quantize(Decimal(digit),rounding=ROUND_HALF_UP)

MOD = 1000000007
INF = float("inf")
sys.setrecursionlimit(10**5+10)

X = I()
five_l = [-1]*200
f=0
for a in range(200):
    five_l[a]=pow(a,5)
    now = five_l[a]
    for i in range(a+1):
        search = five_l[i]
        if search+now==X:
            f = 1
            print(a,-i)
            break
        elif now-search == X:
            print(a,i)
            f = 1
            break
    if f==1:
        break

Solution (Python):
N = int(input())
s = 0
a = 0
import math

while s== 0:
  
  if a**5 > N:
    b = math.floor( (a**5 - N)**(1/5) )
    c = 1
  else:
    b = math.floor( (N - a**5)**(1/5) )
    c = 2
  
  if c == 1 and a**5 - b**5 == N:
    s = 1
  elif  c == 2 and a**5 + b**5 == N:
    b = -b	
    s = 1
  else:
    a += 1  
  
print(a,b)

Solution (Python):



import math
import itertools
from collections import defaultdict
from collections import Counter
import numpy as np

import heapq



n=int(input())
a=[i**5 for i in range(1000)]
ans=set()
for i in a:
    for j in a:
        ans.add(i+j)
        ans.add(i-j)
        if i+j==n:
            print(int(i**(1/5)),int((j**(1/5))*(-1)))
            exit()
        if i-j==n:
            print(int(i**(1/5)),int(j**(1/5)))
            exit()

Solution (Python):
X = int(input())
for a in range(-500, 501):
    for b in range(-500, 501):
        if a**5 - b**5 == X:
            print(a, b)
            exit()

Solution (Python):
SIZE = 200
def main():
    X = int(input())
    for A in range(-SIZE, SIZE):
        for B in range(-SIZE, SIZE):
            if A ** 5 - B ** 5 == X:
                print(A, B)
                break
        else: continue
        break
    return

if __name__ == '__main__':
    main()

Solution (Python):
x=int(input())
if x>=0:
	a=0
	while True:
		b5=a**5-x
		if b5>=0:
			b=int(b5**(1/5))
		else:
			b=int((-1)*((-1)*b5)**(1/5))
		if a**5-b**5==x:
			print(a,b)
			break
		elif a**5-(b+1)**5==x:
			print(a,b+1)
			break
		elif a**5-(b-1)**5==x:
			print(a,b-1)
			break
		a+=1
else:
	a=0
	while True:
		b5=a**5-x
		if b5>=0:
			b=int(b5**(1/5))
		else:
			b=int((-1)*((-1)*b5)**(1/5))
		if a**5-b**5==x:
			print(a,b)
			break
		elif a**5-(b+1)**5==x:
			print(a,b+1)
			break
		elif a**5-(b-1)**5==x:
			print(a,b-1)
			break
		a-=1

Solution (Python):
lim = int(1e5 + 1)
x = int(input())
d = {}
for i in range(-lim, lim):
    d[pow(i, 5)] = i
for i in range(-lim, lim):
    res = pow(i, 5) + x
    if res in d:
        print(d[res], i)
        break

Solution (Python):
import sys
sys.setrecursionlimit(10**6) 
import math
from copy import copy, deepcopy
from operator import itemgetter

from bisect import bisect_left, bisect, bisect_right

from collections import deque 



from collections import Counter

from itertools import accumulate

from heapq import heapify,heappop,heappush


def input(): return sys.stdin.readline()[:-1]
def printl(li): print(*li, sep="\n")
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds




X = int(input())






for A in range(-120,120):
    for B in range(-120,120):
        if A**5-B**5==X: 
            print(A,B)
            exit()

Solution (Python):

x = int(input())

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

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

number = 1000

minus = False
end = False

a = 0
b = 0

for i in range(number):
    a = i + 1
    a5 = pow(a, 5)
    if a5 < x:
        minus = True
        surplus = x - a5
    else:
        minus = False
        surplus = a5 - x
    if surplus == 0:
        b = 0
        break
    elif a == 1:
        continue
    for j in range(i):
        b = j + 1
        b5 = pow(b, 5)
        if b5 == surplus:
            if minus:
                b = -b
            end = True
            break
    if end:
        break

print("{} {}".format(a,b))

Solution (Python):
import sys
input=sys.stdin.readline
x=int(input())
for a in range(101):
    for b in range(101):
        if a**5+b**5==x:
            print(a,-b)
            sys.exit()
for a in range(150):
    for b in range(150):
        if a**5-b**5==x:
            print(a,b)
            sys.exit()

Solution (Python):

"""
@author: H_Hoshigi
"""
def f():
    N = 1000
    X = int(input())
    pow5_list = [pow(i, 5) for i in range(N)]
    A, B = 0, 0
    for i in range(N):
        for j in range(i-1, 0, -1):
            if pow5_list[i] - pow5_list[j] == X:
                A, B = i, j
                return A, B
        for k in range(i+1):
            if pow5_list[i] + pow5_list[k] == X:
                A, B = i, -k
                return A, B

def main():
    A, B = f()
    print("{} {}".format(A, B))

if __name__ == "__main__":
    main()

Solution (Python):
import math
import sys

X = int(input())
X_soinsu = []
for i in range(1, int(math.sqrt(X))+1):
    if X % i == 0:
        X_soinsu.append(i)
        X_soinsu.append(X//i)

for abs_b in range(0, 10000):
    for b in [abs_b, -abs_b]:
        for soinsu in X_soinsu:
            a = b + soinsu
            if a**5 - b**5 == X:
                print(a, b)
                sys.exit(0)

Solution (Python):
X = int(input())
size=2*10**2
kumi={}
for i in range(-size,size):
    for j in range(-size,size):
        tmp=i**5 - j**5
        if tmp not in kumi:
            kumi[tmp]=[i,j]

print(kumi[X][0],kumi[X][1])

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

a = -int(X**(1/4))
b = int(X**(1/4))
for x in range(a, b):
  for y in range(a, b):
    if x**5 - y**5 == X:
      print(x, y)
      break
  else:
    continue
  break

Solution (Python):
import sys
from itertools import combinations_with_replacement

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    X = int(rl())
    
    five_pow = [0]
    i = 1
    while five_pow[-1] < 10 ** 18:
        five_pow.append(i ** 5)
        i += 1
    
    for a, b in combinations_with_replacement(range(len(five_pow)), 2):
        p_of_a, p_of_b = five_pow[a], five_pow[b]
        if p_of_a - p_of_b == X:
            print(a, b)
            exit()
        if p_of_a + p_of_b == X:
            print(a, -b)
            exit()
        if p_of_b - p_of_a == X:
            print(b, a)
            exit()
        if p_of_b + p_of_a == X:
            print(b, -a)
            exit()


if __name__ == '__main__':
    solve()

Solution (Python):
import sys
x = int(input())
pow5s = [i ** 5 for i in range(-200, 201)]
for ap200, a5 in enumerate(pow5s):
    for bp200, b5 in enumerate(pow5s):
        if a5 - b5 == x:
            print(int(ap200 - 200), int(bp200 - 200))
            sys.exit()

Solution (Python):
import math
X=int(input())
t=int(math.sqrt(X))
L=[]
for i in range(1,t+1):
	if X%i==0:
		L.append([i,X//i])
for i in range(10010):
	for x,y in L:
		j=i-x
		tmp=pow(i,4)+pow(i,3)*j+pow(i,2)*pow(j,2)+i*pow(j,3)+pow(j,4)
		if tmp==y:
			print(i,j)
			exit()
		j=i-y
		tmp=pow(i,4)+pow(i,3)*j+pow(i,2)*pow(j,2)+i*pow(j,3)+pow(j,4)
		if tmp==x:
			print(i,j)
			exit()

Solution (Python):
I=lambda : list(map(int,input().split()))
a,=I();f=0
r=[pow(j,5) for j in range(-1000,1001)]
for i in range(len(r)):
    for j in range(len(r)):
        if r[i]-r[j]==a:
            print(i-1000,j-1000);f=1;break
    if f:
        break

Solution (Python):


ipnl = lambda n: [int(input()) for _ in range(n)]
inp = lambda :int(input())
ip = lambda :[int(w) for w in input().split()]
mp = lambda :map(int,input().split())

dt = {}
x = []
for i in range(300):
    dt[i**5] = i
    x.append(i**5)
num = inp()
if num in dt:
    print(dt[num],0)
    exit()
n = len(x)
for i in range(n-1):
    for j in range(i+1,n):
        if x[i] + x[j] == num:
            print(dt[x[i]],-dt[x[j]])
            exit()
        elif x[j] - x[i] == num:
            print(dt[x[j]],dt[x[i]])

Solution (Python):
x = int(input())
A=[a**5 for a in range(500)]
for b in range(10000):
    tmp=x+b**5
    if tmp in A:
        print(A.index(tmp),b)
        exit()
    tmp=x-b**5
    if tmp in A:
        print(A.index(tmp),-b)
        exit()

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

def calc(x):
    for i in range(-1000, 1001):
        for j in range(i+1, 1001):
            if ((j**5) - (i**5)) == x:
                print(j, i)
                return
calc(x)

Solution (Python):



X = int(input())
n=[i**5 for i in range(121)]
m=[i**5 for i in range(121)]

for i in n:
    for j in m:
        if i-j==X:
            print(n.index(i),m.index(j))
            exit()
        elif i+j==X:
            print(n.index(i),-m.index(j))
            exit()

Solution (Python):
import sys


def input():
    return sys.stdin.readline().strip()


def main():
    X = int(input())
    check = [i ** 5 for i in range(-5 * (10 ** 2), 5 * (10 ** 2))]
    for i in range(len(check) - 1):
        for j in range(i + 1, len(check)):
            if check[j] - check[i] == X:
                print(j - 500, i - 500)
                return


if __name__ == "__main__":
    main()

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

anses = set()
i = 0
while True:
    anses.add(i)
    anses.add(-i)
    if i**5 > 10**18:
        break
    i += 1

for a in list(anses):
    for b in list(anses):
        if a**5 - b**5 == x:
            print(a,b)
            exit(0)

Solution (Python):
import sys
inf = 10**15
mod = 10**9+7
x = int(input())
for i in range(-10**5, 10**5+1):
    tmp = i**5-x
    b = int(abs(tmp)**(1/5))
    if b**5 == abs(tmp):
        if tmp > 0:
            print('{} {}'.format(i, b))
        else:
            print('{} {}'.format(i, -b))
        sys.exit()

Solution (Python):
x = int(input())
for a in range(0,1000):
    for b in range(-1000,1000):
        if a**5 - b**5 ==x:
            print(str(a)+" "+str(b))
            exit()

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

A = 0

while True:
    temp = X - A ** 5
    if temp >= 0:
        B = int(pow(temp, 1/5))
    else:
        B = -int(pow(-temp, 1/5))
    if A ** 5 + B ** 5 == X:
        print(A, -B)
        break
    A += 1

Solution (Python):
def resolve():
    x = int(input())
    aa = [i**5 for i in range(1000)]

    for i in range(len(aa)):
        a = aa[i]
        for j in range(len(aa)):
            b = aa[j]
            if a - b == x:
                print(i,j)
                break
            elif a + b == x:
                print(i,-j)
                break
            elif -a - b == x:
                print(-i, j)
                break
            elif -a + b == x:
                print(-i, -j)
                break
        else:
            continue
        break

if __name__ == '__main__':
    resolve()

Solution (Python):

import sys


def solve(X: int):
    
    for a in range(0, 101):
        for b in range(0, -101, -1):
            if a**5 - b**5 == X:
                print(a, b)
                exit()

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

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

Solution (Python):
x = int(input())
a = []
b = []
for i in range(-200,200):
    a.append([i, i**5])
    b.append([i, i**5])

n = len(a)

for i in range(n):
    for j in range(n):
        if a[i][1] - b[j][1] == x:
            print(str(a[i][0]) + " " + str(b[j][0]))
            exit()
        if b[j][1] - a[i][1] == x:
            print(str(b[j][0]) + " " + str(a[i][0]))
            exit()
        if a[j][1] - b[i][1] == x:
            print(str(a[j][0]) + " " + str(b[i][0]))
            exit()
        if b[i][1] - a[j][1] == x:
            print(str(b[i][0]) + " " + str(a[j][0]))
            exit()

Solution (Python):
X = int(input())
for a in range(10**4):
    for b in range(-10**4,10**4):
        if a**5 - b**5 == X:
            print(a,b)
            break
    else:
        continue
    break

Solution (Python):
def main():
    X = int(input())
    for A in range(10**7):
        tmp = pow(A,5) - X
        if tmp == 0:
            print(A,0)
            exit()
        elif tmp < 0:
            for i in range(-1,-(10**7),-1):
                if tmp == pow(i,5) and pow(A,5) - pow(i,5) == X:
                    print(A,i)
                    exit()
                elif tmp > pow(i,5):
                    break
        else:
            for i in range(1,10**7):
                if tmp == pow(i,5) and pow(A,5) - pow(i,5) == X:
                    print(A,i)
                    exit()
                elif tmp < pow(i,5):
                    break



if __name__ == "__main__":
    main()

Solution (Python):



from collections import defaultdict, Counter
from functools import lru_cache
from heapq import heappush, heappop
from math import gcd, floor, ceil
from sys import stdin, stdout

def ilist():
    return [int(x) for x in stdin.readline().strip().split(" ")]
def iint():
    return int(stdin.readline().strip())
def istr():
    return stdin.readline().strip()



def solve(X):
    c = {}
    for i in range(1000):
        c[i] = i ** 5
        c[-i] = -c[i]
    for i in c:
        for j in c:
            if c[i] - c[j] == X:
                return str(i) + " " + str(j)


if __name__ == '__main__':
    X = iint()
    print(solve(X))

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

for A in range(10**4):
    for B in range(-10**4,10**4):
        if A**5-B**5==X:
            print('{} {}'.format(A,B))
            break
    else:
        continue
    break

Solution (Python):
import bisect as bi
import collections as cc
I=lambda:list(map(int,input().split()))
x,=I()
ar=[]
i=1
fl=1

t=bi.bisect_left(ar,x)
for i in range(-1000,1000):
    for j in range(-1000,1000):
        if pow(i,5)-pow(j,5)==x:
            print(i,j)
            fl=0
            break
    if not fl:
        break

Solution (Python):
import sys
from bisect import bisect_left


sys.setrecursionlimit(10 ** 6)
INF = float("inf")
MOD = 10 ** 9 + 7


def input():
    return sys.stdin.readline().strip()


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


def main():
    X = int(input())
    d = set()
    for i in range(100000):
        d.add(i ** 5)
    D = sorted(d)
    idx = {v: i for i, v in enumerate(D)}
    for i in d:
        if X - i in d:
            print(idx[i], -idx[X - i])
            break
        elif i - X in d:
            print(idx[i], idx[i - X])
            break


if __name__ == "__main__":
    main()

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

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

ans_a = 0
ans_b = 0

finish = 0

for b in range(10**3):
    for a in range(b, 10**3):
        sa = l[a] - l[b]
        wa = l[a] + l[b]
        if sa > X:
            continue
        if sa == X:
            ans_a = a
            ans_b = b
            finish = 1
            break
        if wa == X:
            ans_a = a
            ans_b = -b
            finish = 1
            break
    if finish:
        break

print(ans_a, ans_b)

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

N = 10**3

f = False
for i in range(N+1):
    for j in range(N+1):
        if i**5-j**5 == X:
            print(i, j)
            f = True
            break
        if i**5+j**5 == X:
            print(i, -j)
            f = True
            break
    if f:
        break

Solution (Python):
x = int(input())
def ans(x):
    for a in range(0, 1000)[::-1]:
        for b in range(-1000, 1000)[::-1]:
            if a**5 - b**5 == x:
                return a, b
a,b = ans(x)
print(a,b)

Solution (Python):
X = int(input())
for A in range(10000):
    if abs((abs(A**5-X))**0.2 - int(abs(A**5-X)**0.2)) < 0.0000001:
        B = int(abs(A**5-X)**0.2)
        if A**5 - B**5 == X:
            print(A, " ", B)
            break
        else:
            print(A, " ", -1*B)
            break

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

lim = int(x**0.25)

for a in range(0,lim+1):
    b5 = (pow(a,5)-x)
    if b5 <0:
        fugou=-1
    else:
        fugou=+1
    b5 = abs(b5)
    if pow(int(b5 ** 0.2),5)==b5:
        break

print(a, fugou*int(b5**0.2))

Solution (Python):
n=int(input())
x= list(range(-1000, 1000, 1))

a = 100
b = 100
for i in x:
    for j in x:
        if i**5-j**5 == n:
            print(i, end=" ")
            print(j)
            exit()

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

for a in range(1000):
    for b in range(1000):
        if a**5 - b**5 == x:
            c=a
            d=b
        if a**5 + b**5 ==x:
          c=a
          d=-1*b
print(str(c)+" "+str(d)+"\n")

Solution (Python):
X = int(input())
flag = 0
for i in range(1,int(X**0.5)+1):
    if X%i==0:
        x = i
        y = X//i
        for b in range(-int(10**(9/5))-1,int(10**(9/4))+1):
            a = b+x
            if a**4+a**3*b+a**2*b**2+a*b**3+b**4==y:
                A = a
                B = b
                flag = 1
                break
        if flag==1:break
print(A,B)

Solution (Python):
x=int(input())
f=False
for a in range(10000+1):
    for b in range(-10000,10000+1):
        v=a**5-b**5
        if v==x:
            f=True
            break
    if f:
        break
print(str(a) + " " + str(b))

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

def solve(x):
	for first in range(-150, 150):
		for sec in range(-150, 150):
			if first**5 - sec**5 == x:
				print(first, sec)
				return

solve(x)

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


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

Solution (Python):
X=int(input())
for a in range(3*10**2):
  for b in range(6*10**2):
    if(a**5-(b-300)**5==X):
      print(a,b-300)
      exit()

Solution (Python):
from heapq import *
import sys
from collections import *
from itertools import *
from decimal import *
import copy
from bisect import *
import math
sys.setrecursionlimit(4100000)
def gcd(a,b):
    if(a%b==0):return(b)
    return (gcd(b,a%b))
input=lambda :sys.stdin.readline().rstrip()
X=int(input())
lst=[]
N=500000
for i in range(-N,N+1):
    lst.append([i**5,i])
B=set([A for A,a in lst])
dic=defaultdict(int)
for A,a in lst:
    dic[A]=a
for A,a in lst:
    if A-X in B:
        print(a,dic[A-X])
        exit()

Solution (Python):
from math import *

a=[]
for i in range(-501,501):
	a.append([int(pow(i,5)),i])

b=[]
for i in range(len(a)):
	for j in range(len(a)):
		if a[i][0]-a[j][0]>0:
			b.append([a[i][0]-a[j][0],a[i][1],a[j][1]])

x=int(input())

for i in range(len(b)):
	if b[i][0]==x:
		print(b[i][1],b[i][2])
		break

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

Solution (Python):
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())
for i in make_divisors(x):
    b = -i//2
    a = b + i
    while a**5-b**5 <= x:
        if a**5-b**5 == x:
            print(a,b)
            exit()
        a += 1
        b += 1

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

for a in range(-1000, 1000):
    for b in range(-1000, 1000):
        if (a ** 5 - b ** 5 == x):
            print(f"{a} {b}")
            exit()

Solution (Python):
import numpy as np
x = int(input())
for i in range(100000):
    if(i ** 5 -x > 0):
        b = int(pow(i**5-x,1/5))
        if(b**5 == i**5-x):
            print(i,b)
            break
    else:
        b = int(pow(-i**5+x,1/5))
        if(b**5 == -i**5+x):
            print(i,-b)
            break

Solution (Python):
import collections
import math
import operator as op
from functools import reduce
from collections import Counter
import numpy as np
import math
import bisect
import heapq


def get_inputs(cast_func=None):
    if cast_func is None:
        return input().split()
    else:
        return list(map(cast_func, input().split()))


def get_input(cast_func=None):
    if cast_func is None:
        return input()
    else:
        return cast_func(input())


def main():
    X = get_input(int)
    A5_cache = {}
    for A in range(10000000):
        A5 = A**5
        A5_cache[A5] = A

        B5 = A5 - X
        if B5 in A5_cache:
            B = A5_cache[B5]
            break
        elif -B5 in A5_cache:
            B = -A5_cache[-B5]
            break
    assert A**5 - B**5 == X
    print(A, B)

        

if __name__ == '__main__':
    main()

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

for i in range(-178,178):
    for j in range(-178,178):
        if ((i**5)-(j**5) == X):
            A = i
            B = j
            break

print(A,B)

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

f5=list()

i=0
while i**5<=10**12+6:
    f5.append(i**5)
    i+=1


for i in range(len(f5)):
    for j in range(len(f5)):
        if f5[i] + f5[j]== x:
            a=i
            b=-j
        if f5[i] - f5[j] == x:
            a=i
            b=j

print(a,b)

Solution (Python):
x = int(input())
a = int(x**(1/4))
for i in range(1,a+1):
    for l in range(-a,i):
        if i**5-l**5==x:
            print(i,l)
            exit()

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

from itertools import product
tot_comb = [el for el in product(list(range(-120, 121)), list(range(-120, 121))) if el[0]!=el[1]]
tot_comb += [(0,0)]
num_dict = {el[0]**5 - el[1]**5: el for el in tot_comb}
pair = num_dict[x]
print(pair[0], pair[1])

Solution (Python):
import math

def solve():
    powers = []
    n = 0
    c = 0
    while n < (2 * 10 ** 20):
        n = c ** 5
        c += 1
        powers.append(n)
    for p in powers:
        for pp in powers:
            if p - pp == k:
                print(round(p ** (1/5)), round(pp ** (1/5)), sep=" ")
                exit()
            elif p + pp == k:
                print(round(p ** (1/5)), -round(pp ** (1/5)), sep=" ")
                exit()
    return


k = int(input())
solve()

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

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

Solution (Python):
from collections import defaultdict,deque
import sys, bisect, math, itertools
from functools import lru_cache

sys.setrecursionlimit(10**8)
input = sys.stdin.readline
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp():
    '''
    一つの整数
    '''
    return int(input())
def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split()))

x = inp()
a = 0
b = -100
@lru_cache(maxsize=None)
def dp(a,b):
    return a**5-b**5
while True:
    while True:
        if dp(a,b) >= x:
            break
        a += 1
    while True:
        if dp(a,b) <= x:
            break
        b += 1
    if dp(a, b) == x:
        break
print(a,b)