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())
A = 0
flag = False
while True:
    B = A-1
    while pow(B,5)>=pow(A,5)-X:
        if pow(B,5)==pow(A,5)-X:
            flag=True
            break
        B -= 1
    if flag:
        break
    A+=1
print(A,B)

Solution (Python):
X = int(input())
for a in range(-10**3, 10**3+1):


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

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

l = range(-10**3,10**3)

for i in l:
  for j in l:
    if i**5 - j**5 == X:
      print(str(i) + " " + str(j))
      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(a,b)
            break
    else:
        continue
    break

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

X = int(input())

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

Solution (Python):
from collections import defaultdict
from math import gcd
import time
import sys
from collections import Counter
import itertools
import math
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
start = time.time()

X = int(input())

gojou = []
i = 0
saidai = 10**12

while 1:
    temp = i**5
    if temp > saidai:
        break
    gojou.insert(0, [i, temp])
    gojou.insert(0, [-i, -temp])
    i += 1

ls = len(gojou)
for i in range(ls):
    for j in range(i, ls):
        if gojou[i][1]-gojou[j][1] == X:
            print(gojou[i][0], gojou[j][0])
            exit()

Solution (Python):
import sys
def input():
    return sys.stdin.readline().rstrip('\n')


def calc(X):
    i = 0
    while True:
        y = i ** 5
        if y == X:
            return "{0} {1}".format(i, 0)
        elif y < X:
            j = int((X - y) ** (1 / 5))
            intj = int(j)
            if abs(j - intj) < 1e-5 and y + intj ** 5 == X:
                return "{0} {1}".format(i, -intj)
        else:
            j = int((y - X) ** (1 / 5))
            intj = int(j)
            if abs(j - intj) < 1e-5 and y - intj ** 5 == X:
                return "{0} {1}".format(i, intj)
        i += 1
    

X = int(input())
print(calc(X))

Solution (Python):
res = {}
for i in range(-500, 500):
    for j in range(-500, 500):
        ans = i ** 5 - j ** 5
        res[ans] = (i, j)
n = int(input())
print(res[n][0], res[n][1])

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

for A in range(100000000):
    flg=0
    for B in range(A):
        if A**5 - B**5 == X:
            print(A,B)
            flg=1
            break
        if A**5 + B**5 == X:
            print(A,B*(-1))
            flg=1
            break
    if flg==1:
        break

Solution (Python):





import itertools


inputs: list = []
while True:
    try:
        inputs.append(input().strip('\n'))
    except EOFError:
        break


x = float(inputs[0])

a_range = range(1, 10**3)
b_range = range(-10**3, 10**3)

for a in a_range:
    for b in b_range:
        if a ** 5 - b ** 5 == x:
            print(a, b)
            break
    else:
        continue
    break

Solution (Python):
x = int(input())
for a in range(-1000,1000):
    f = 0
    for b in range(-1000,1000):
        if a**5-b**5==x:
            print(a,b)
            f = 1
            break
    if f:
        break

Solution (Python):
a5=[i**5 for i in range(300)]
x=int(input())
flag=0
for i in range(300):
  for j in range(300):
    if flag==0 and a5[i]-a5[j]==x:
      print(str(i)+" "+str(j))
      flag=1
    if flag==0 and a5[i]+a5[j]==x:
      print(str(i)+" -"+str(j))
      flag=1

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

m=dict()
for a in range(-100000,100001):
    a5=int(math.pow(a,5))
    m[a5]=a

for b in range(-100000,100001):
    b5=int(math.pow(b,5))
    a5=b5+x
    if a5 in m:
        a=m[a5]
        print(a,b)
        break

Solution (Python):
import itertools


X = int(input())

u = -1000
A = []
while u < 1000:
    A.append(u)
    u += 1
AA = list((itertools.product(A, repeat=2)))
for a,b in AA:
    if a**5-b**5 == X:
        print(a,b)
        break

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

for i in range(1, 200):
    resid = i ** 5 - x
    for j in range(-200, 200):
        if j**5 == resid:
            print(i, j)
            flag = True
            break
    if flag:
        break

Solution (Python):
x = int(input())
import sys
if x == 1:
    print(1, 0)
    sys.exit()
for i in range(x):
    if i ** 5 == x:
        print(i, 0)
        sys.exit()
    for j in range(1, i):
        for j in range(1, i):
            if i ** 5 - (-j) ** 5 == x:
                print(i, -j)
                sys.exit()
            elif i ** 5 - j ** 5 == x:
                print(i, j)
                sys.exit()
            else:
                continue

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())
div=make_divisors(x)
def depth_limited(x,div):
    depth=-50
    while True:
        depth+=50
        for t in div:
            for b in range(depth,depth+50):
                if x==t*(5*b**4+10*b**3*t+10*b**2*t**2+5*b*t**3+t**4):
                    return (b+t,b)
                b=-b
                if x==t*(5*b**4+10*b**3*t+10*b**2*t**2+5*b*t**3+t**4):
                    return (b+t,b)
ans=depth_limited(x,div)
print(str(ans[0])+' '+str(ans[1]))

Solution (Python):

X = int(input())


a, b = 0, 0

nl = []
i = 0
np = 0
n = i**5
while n - np <= 10**9:
    nl.append(n)
    i += 1
    np = n
    n = i**5

for i in range(len(nl)):
    t = X-nl[i]
    if t in nl:
        a = i
        b = -(nl.index(t))
        break

    if -t in nl:
        a = i
        b = nl.index(-t)
        break


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

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

a = 2
b = 1

n = int((X ** (1 / 5)) // 1) * 100



for a in range(1, n + 10):
    minus = 1
    b5 = (a ** 5) - X
    if b5 < 0:
        minus = -1
        b5 *= - 1
    b = int(pow(b5, (1 / 5)))
    if (a ** 5 - b ** 5 * minus) == X:
        
        print(a, b * minus)
        
        exit()

Solution (Python):



def input_int():
    return int(input())



def int1(x):
    return int(x) - 1



def input_to_int_map():
    return map(int, input().split())



def input_to_int_tuple():
    return tuple(map(int, input().split()))



def input_to_int_tuple_minus1():
    return tuple(map(int1, input().split()))


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

    import math
    test = math.ceil(math.sqrt(math.sqrt(x)))

    for i in range(-test, test + 1):
        for j in range(-test, test + 1):
            if i ** 5 - j ** 5 == x:
                return " ".join([str(i), str(j)])


if __name__ == "__main__":
    print(main())

Solution (Python):
import sys
x=int(input())
for a in range(-200,200):
  for b in range(-200,200):
    if a**5-b**5 ==x:
      print(a,b)
      sys.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

divisors = make_divisors(x)

for divisor in divisors:
  for a in range(1000):
    b = a - divisor
    if (a**5 - b**5 == x):
      print(a, b)
      break

Solution (Python):
X = int(input())
MAX = 10**4
Flag = False
for i in range(MAX):
    A = i
    for j in range(A,MAX):
        B = j
        if A**5 - B**5 == X:
            print(A,B)
            Flag = True
            break
        elif A**5 + B**5 == X:
            print(A,-B)
            Flag = True
            break
        elif B**5 - A**5 == X:
            print(-A,-B)
            Flag = True
            break
    if Flag:
        break

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

Solution (Python):
import sys

N = int(input())

L = [(a, a ** 5) for a in range(-200, 200)]

for a, a5 in L:
    for b, b5 in L:
        if b5 - a5 == N:
            print(b, a)
            sys.exit(0)

Solution (Python):


x = int(input())




nmax = 119
dic = {}
for a in range(nmax+1):
    for b in range(nmax+1):
        a5 = a**5
        b5 = b**5
        m = a5 - b5
        if m not in dic:
            dic[m] = [a, b]

        n = a5 + b5
        if n not in dic:
            dic[n] = [a, -b]



a,b = dic[x]
print(a, b)

Solution (Python):











X = int(input())

li = []

n = -1000

while n**5 < 10**15:
    li.append(n**5)
    n += 1

for ai, a in enumerate(li):
    for bi, b in enumerate(li):
        if a - b == X:
            print(ai-1000, bi-1000)
            exit(0)

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

Solution (Python):
import math


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

    MAX = 10 ** 9

    for b in range(0, MAX + 1):
        
        a = math.pow(abs(b ** 5 + X), 1 / 5)
        
        
        if round(a) ** 5 == abs(b ** 5 + X):
            if b ** 5 + X > 0:
                print(int(a), b)
                return
            else:
                print(-int(a), b)
                return

        
        a = math.pow(abs(- b ** 5 + X), 1 / 5)
        
        if round(a) ** 5 == abs(- b ** 5 + X):
            if - b ** 5 + X > 0:
                print(int(a), -b)
                return
            else:
                print(-int(a), -b)
                return

    raise ValueError()


if __name__ == '__main__':
    main()

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):
x=int(input())
for a in range(-3000,3000):
    for b in range(-3000,3000):
        if a**5-b**5==x:
            print("{} {}".format(a,b))
            exit()

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

Solution (Python):
x = int(input())
for a in range(10**3):
    for b in range(10**3):
        if a**5 - b**5 == x: 
            print(a, b)
            exit()
        elif a**5 + b**5 == x:
            print(a, -b)
            exit()
print('error')

Solution (Python):
import sys
x = int(input())
for i in range(-1000,1001):
  for j in range(-1000,1001):
    if x == i**5-j**5:
      print(f"{i} {j}")
      sys.exit()

Solution (Python):
from sys import stdin
from sys import setrecursionlimit

setrecursionlimit(10 ** 7)

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

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

Solution (Python):
from collections import defaultdict


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


if __name__ == '__main__':
    X = int(input())
    divs = make_divisors(abs(X))
    for div in divs:
        for a in range(1, int(X ** .5) + 1):
            b = a - div
            if a ** 5 - b ** 5 == X:
                print(a, b)
                exit()

            b = -a - div
            if (-a) ** 5 - b ** 5 == X:
                print(-a, b)
                exit()

Solution (Python):
X = int(input())
tane = [x**5 for x in range(130)]

flag = 0
for i in range(len(tane)):
    for j in range(len(tane)):
        a = tane[i]
        b = tane[j]
        if a - b == X:
            print(i,j)
            flag = 1
            break
        elif -a -b ==X:
            print(-i,j)
            flag = 1
            break
        elif a + b == X:
            print(i,-j)
            flag = 1
            break
        elif -a + b == X:
            print(-i,-j)
            flag = 1
            break
    if flag == 1:
        break

Solution (Python):
to_the_5 = [0, 1, 32, 243, 1024, 3125, 7776, 16807, 32768, 59049, 100000, 161051, 248832, 371293, 537824, 759375, 1048576, 1419857, 1889568, 2476099, 3200000, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176, 69343957, 79235168, 90224199, 102400000, 115856201, 130691232, 147008443, 164916224, 184528125, 205962976, 229345007, 254803968, 282475249, 312500000, 345025251, 380204032, 418195493, 459165024, 503284375, 550731776, 601692057, 656356768, 714924299, 777600000, 844596301, 916132832, 992436543, 1073741824, 1160290625, 1252332576, 1350125107, 1453933568, 1564031349, 1680700000, 1804229351, 1934917632, 2073071593, 2219006624L, 2373046875L, 2535525376L, 2706784157L, 2887174368L, 3077056399L, 3276800000L, 3486784401L, 3707398432L, 3939040643L, 4182119424L, 4437053125L, 4704270176L, 4984209207L, 5277319168L, 5584059449L, 5904900000L, 6240321451L, 6590815232L, 6956883693L, 7339040224L, 7737809375L, 8153726976L, 8587340257L, 9039207968L, 9509900499L, 10000000000L, 10510100501L, 11040808032L, 11592740743L, 12166529024L, 12762815625L, 13382255776L, 14025517307L, 14693280768L, 15386239549L, 16105100000L, 16850581551L, 17623416832L, 18424351793L, 19254145824L, 20113571875L, 21003416576L, 21924480357L, 22877577568L, 23863536599L, 24883200000L]

X = int(raw_input())

for i in range(len(to_the_5)):
	for j in range(len(to_the_5)):
		if to_the_5[i] - to_the_5[j]  == X:
			print '{} {}'.format(i, j)
			exit()
		if to_the_5[i] + to_the_5[j] == X:
			print '{} -{}'.format(i, j)
			exit()

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

def nb(b):
    if b == 0:
        return 1
    elif b > 0:
        return -b
    else:
        return -b+1

b = 0

def fac(x):
    if x>=0:
        return x**0.2
    else:
        return -(-x)**0.2

while 1:
   

    
    a_est = int(fac(b**5+X))
    if a_est**5-b**5==X:
        a = a_est
        break
    elif (a_est+1)**5-b==X:
        a = a_est+1
        break
    
    
    b = nb(b)

print(a,b)

Solution (Python):
from sys import stdin
x = int(stdin.readline().rstrip())
k = True
a = 0
while k:
    b = a**5 - x
    c = False
    if b < 0:
        b *= (-1)
        c = True
    d = int(b**(1/5))    
    if d ** 5 == b:
        k = False
        break
    a += 1
if c:
    d *= -1
print(a,d)

Solution (Python):
x = int(input())
n = int((10**9)**(1/5))
for a in range(10**3):
    for b in range(10**3):
        if a**5 - b**5 == x: 
            print(a, b)
            exit()
        elif a**5 + b**5 == x:
            print(a, -b)
            exit()
print('error')

Solution (Python):
x=int(input())
gojo=[]
for i in range(-120,120):
    gojo.append(i**5)
for i in range(len(gojo)-1):
    for j in range(i+1,len(gojo)):
        if x==gojo[j]-gojo[i]:
            ans=[j-120,i-120]
for i in ans:
    print(i,end=" ")

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

ans = []
for i in range(0, x//2+1):
    a = i**5
    diff = x - a

    if diff == 0:
        ans.append(i)
        ans.append(0)
        break

    elif diff < 0:
        j = 0
        while True:
            b = j**5
            if diff*(-1) < b:
                break
            if a-b == x:
                ans.append(i)
                ans.append(j)
                break
            j += 1

    elif diff > 0:
        j = 0
        while True:
            b = j**5
            if diff < b:
                break
            if a+b == x:
                ans.append(i)
                ans.append(j*(-1))
                break
            j += 1

    if len(ans) != 0:
        break

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

Solution (Python):
from bisect import bisect_right
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

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

    A = [i**5 for i in range(10**6)]
    for b in A:
        a = x + b
        idx = bisect_right(A, a) - 1
        if A[idx] == a:
            print(int(pow(a, 0.2)), int(pow(b, 0.2)))
            break
        
        a = x - b
        idx = bisect_right(A, a) - 1
        if A[idx] == a:
            print(int(pow(a, 0.2)), -int(pow(b, 0.2)))
            break


if __name__ == "__main__":
    main()

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

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

lut = [i**5 for i in range(200)]

a = 0
b = 0

for a, a5 in enumerate(lut):
    for b, b5 in enumerate(lut):
        if a5 + b5 == X:
            print(a,-b)
            exit()
        elif a5 -b5 == X:
            print(a, b)
            exit()

Solution (Python):
import math
def main():
  x = int(input())
  r = range(-1000,1000)
  for i in r:
    for j in r:
      if math.pow(i, 5) - math.pow(j, 5) == x:
        print(str(i) + ' ' + str(j))
        return
main()

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

for A in range(-1000,1000):
    for B in range(-1000,1000):
        if A**5-B**5==X:
            print("{} {}".format(A,B))
            exit(0)

Solution (Python):
import itertools

X = int(input())

ansL1 = [i for i in range(130)]
ansL2 = [i * (-1) for i in range(1, 130)]
ansL1.extend(ansL2)

L1 = [pow(i, 5)for i in range(130)]
L2 = [pow((-1)*i, 5)for i in range(1, 130)]
L1.extend(L2)

for v in itertools.combinations(L1, 2):
    if v[0] - v[1] == X:
        for i in range(len(L1)):
            if v[0] == L1[i]:
                ans1 = ansL1[i]
            if v[1] == L1[i]:
                ans2 = ansL1[i]
        print(ans1, ans2)
        exit()

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

Solution (Python):
import sys

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

    num = [-1, 1]
    for i in range(501):
        for j in range(501):
            for k in num:
                for l in num:
                    if((k*i)**5-(j*l)**5 == X):
                        print(i*k, j*l)
                        sys.exit()
main()

Solution (Python):
import sys

x = int(input())
b_p = 0
b_m = 0

def div(n):
    divs = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divs.append(i)
            if i != n // i:
                divs.append(n//i)
    divs
    divs += list(map(lambda x: x*(-1), divs))
    return divs

divs = div(x)
while True:  
    for i in divs:
        a_p = i + b_p
        a_m = i + b_m
        if a_p ** 5 == x + b_p ** 5:
            print(a_p, b_p)
            sys.exit()
        if a_m ** 5 == x + b_m ** 5:
            print(a_m, b_m)
            sys.exit()
    b_p += 1
    b_m -= 1

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

for i in range(1000):
    for j in range(1000):
        if i**5 + j**5 ==x:
            print(i,end=" ")
            print(-j)
            sys.exit()

        if i**5 - j**5 ==x:
            print(i,end=" ")
            print(j)
            sys.exit()

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians

from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    X = INT()

    for i in range(1000):
        for j in range(1000):
            if i**5 - j**5 == X:
                print(i, j)
                sys.exit()
            elif i**5 + j**5 == X:
                print(i, j*(-1))
                sys.exit()


if __name__ == '__main__':
    main()

Solution (Python):
import sys
X = int(input())
for a in range(-200, 201):
    for b in range(-200, 201):
        if a**5 - b**5 == X:
            print(a, b)
            sys.exit()

Solution (Python):
import sys
x = int(input())
a = 1
while True:
    if a ** 5 == x:
        print(a, end = ' ')
        print(0)
        sys.exit()
    for b in range(1, int(abs(x - a ** 5) ** (1/5)) + 1):
        if abs(a ** 5 - x) == b ** 5:
            if a ** 5 - x > 0:
                print(a, end = ' ')
                print(b)
                sys.exit()
            else:
                print(a, end = ' ')
                print(-b)
                sys.exit()
    a += 1

Solution (Python):
x=int(input())
aa=0
ab=0
for a in range (-200,200):
    for b in range (-200,200):
        if a**5-b**5==x:
            aa=a
            ab=b
print(aa,ab)

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


a = [int( i/2)*((-1)**i) for i in range(1, 1000)]
b = [int( i/2)*((-1)**i) for i in range(1, 1000)]



"""
* Aが正ならBは負または、Aより小さい正
* Aが負ならBは負
* X/(a+b)は、1以上の整数
"""

find = False
if X == 0:
  print(0)
else:  
  for a_ in a:
    for b_ in b:

      if a_ + b_ == 0:
        continue
      if a_ >= 0:
        if b_ >= 0 and b_ > a_:
          continue
      if a_ < 0:
        if b_ >= 0:
          continue
      """
      if X%(a_+b_) != 0:
        print("hoge")
        continue
      """
      if (a_**5) - (b_**5) == X:
        print(f"{a_} {b_}")
        find = True
        break
    if find:
      break

Solution (Python):
from math import sqrt
x = int(input())
def f(x):
  h = int(sqrt(x))
  for i in range(1,h+1):    
    if x%i == 0:
      
      m = x//i      
      for a in range(0,1000):        
        b = a-i        
        if a**4 + (a**3)*b + (a**2)*(b**2) + a*b**3 + b**4 ==m:
          return a,b
      
print(*f(x))

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

A = 0
B = 0

f = 0

for i in range(400):
    A = -200 + i
    
    if f == 1:
        break
    
    for j in range(400):
        B = -200 + j
        n = A**5 - B**5
        
        if n == X:
            print(A, end=' ')
            print(B)
            f = 1
            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

def solve(num, X):
    a = 1
    for i in range(1, X+1):
        if (i * 100) ** 5 - (i * 100 - num) ** 5 >= X:
            break
    max_a = 100 * i
    a = max_a - 99
    while a <= max_a:
        if (a) ** 5 - (a -num) ** 5 == X:
            return True, a, a - num
        a += 1
    return False, 0, 0

arr = make_divisors(abs(X))
for num in arr:
    if (num - X) % 5:
        continue
    flag, a, b = solve(num , X)
    if flag:
        print(a, b)
        exit()

Solution (Python):
def main():
    x = int(input())
    L = 500
    lst = [pow(i, 5) for i in range(-L, L+1)]

    for a in range(2*L + 1)[::-1]:
        for b in range(2*L + 1)[::-1]:
            val = lst[a] - lst[b]
            if val == x:
                ansa = a
                ansb = b
                break
    print(ansa-L, ansb-L)
main()

Solution (Python):
import sys

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

lis = make_divisors(X)

for i in range(len(lis)):
    A = 0
    B = 0
    dis = lis[i]
    for i in range(-2000,200):
        A = i
        B = A - dis
        if A ** 5 - B ** 5 == X:
            print(A, B)
            sys.exit()
        else:
            continue

Solution (Python):

X = int(input())

start = -200
end = 201

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

Solution (Python):
D = {}
k = 130
x = int(input())
for i in range(-k, k+1):
    D[i] = i**5
for i in range(-k, k+1):
    for j in range(-k, k+1):
        if D[i]-D[j] == x:
            print(i,j)
            exit()

Solution (Python):

X = int( input() )
maxA = 1000
pow5 = list()
for aa in range(maxA):
    pow5.append( aa**5 )
    

ans = False
for ii in range(maxA):  
    if( ans==False ):
        X1 = X - pow5[ii]
        X2 = X + pow5[ii]
        if( X1 in pow5 ):
            b = - ii
            a = pow5.index( X1 )
            ans = True
        
    if( ans==False ):
        if( X2 in pow5 ):
            b = ii
            a = pow5.index( X2 )
            ans = True


if(ans):
    print( str(a)+' '+str(b) )

Solution (Python):
x = int(input())
kouho = []
for i in range(300):
    kouho.append([i**5,i])
    kouho.append([-i**5,-i])
for i in range(len(kouho)):
    for j in range(len(kouho)):
        if kouho[i][0]-kouho[j][0] == x:
            print(kouho[i][1],kouho[j][1])
            exit()

Solution (Python):
x = int(input())
a = 0
b = 0
for i in range(121):
    tmp = (i ** 5 - x)
    flag = True
    
    if tmp < 0:
        flag = False
    b_kouho = abs(tmp) **(1/5)
    b_kouho = round(b_kouho) * -1
    if flag:
        b_kouho *= -1
    if i**5 - b_kouho**5 == x:
        a = i
        b = b_kouho
        break
print("{} {}".format(int(a),int(b)))

Solution (Python):
X = int(input())
for A in range(1000):
  for B in range(-1000,1000):
    if A ** 5 - B ** 5 == X:
    
      print(A,B)
      exit(0)

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

N = list(range(-150,150))

M =[]
for i in N:
    m = i**5
    M.append(m)
    
for i in range(0,300):
    Y = M[i]+X
    if Y in M:
        l = M.index(Y)
        print(N[l], N[i])
        break

Solution (Python):
def main():
    x=int(input())
    for i in range(-200,200):
        for j in range(-200,200):
            if i**5-j**5==x:
                print(i,j)
                return
    raise Exception()
main()

Solution (Python):
l = [0,1,32,243,1024,3125,7776,16807,32768,59049,100000,161051,248832,371293,537824,759375,1048576,1419857,1889568,2476099,3200000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176,69343957,79235168,90224199,102400000,115856201,130691232,147008443,164916224,184528125,205962976,229345007,254803968,282475249,312500000,345025251,380204032,418195493,459165024,503284375,550731776,601692057,656356768,714924299,777600000,844596301,916132832,992436543,1073741824,1160290625,1252332576,1350125107,1453933568,1564031349,1680700000,1804229351,1934917632,2073071593,2219006624,2373046875,2535525376,2706784157,2887174368,3077056399,3276800000,3486784401,3707398432,3939040643,4182119424,4437053125,4704270176,4984209207,5277319168,5584059449,5904900000,6240321451,6590815232,6956883693,7339040224,7737809375,8153726976,8587340257,9039207968,9509900499,10000000000,10510100501,11040808032,11592740743,12166529024,12762815625,13382255776,14025517307,14693280768,15386239549,16105100000,16850581551,17623416832,18424351793,19254145824,20113571875,21003416576,21924480357,22877577568,23863536599,24883200000,25937424601,27027081632,28153056843,29316250624,30517578125,31757969376,33038369407,34359738368,35723051649,37129300000,38579489651,40074642432,41615795893,43204003424,44840334375,46525874176,48261724457,50049003168,51888844699,53782400000,55730836701,57735339232,59797108943,61917364224,64097340625,66338290976,68641485507,71008211968,73439775749,75937500000,78502725751,81136812032,83841135993,86617093024,89466096875,92389579776,95388992557,98465804768,101621504799,104857600000,108175616801,111577100832,115063617043,118636749824,122298103125,126049300576,129891985607,133827821568,137858491849,141985700000,146211169851,150536645632,154963892093,159494694624,164130859375,168874213376,173726604657,178689902368,183765996899,188956800000,194264244901,199690286432,205236901143,210906087424,216699865625,222620278176,228669389707,234849287168,241162079949,247609900000,254194901951,260919263232,267785184193,274794888224,281950621875,289254654976,296709280757,304316815968,312079600999,320000000000]

x = int(input())

flag = False
for i in range(len(l)):
    for j in range(len(l)):
        a = l[i]
        b = l[j]
        if a - b == x:
            print("{} {}".format(i, j))
            
            flag = True
            break
        
        a = l[i] * -1
        b = l[j]
        if a - b == x:
            print("{} {}".format(i * -1, j))
            
            flag = True
            break
        
        a = l[i]
        b = l[j] * -1
        if a - b == x:
            print("{} {}".format(i, j * -1))
            
            flag = True
            break
        
        a = l[i] * -1
        b = l[j] * -1
        if a - b == x:
            print("{} {}".format(i * -1, j * -1))
            
            flag = True
            break
        
    if flag:
        break

Solution (Python):

    

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


    def isOK(A, B):
        eq = A**5 - B**5
        if X <= eq:
            return True
        else:
            False
    
    def bin_search(B):
        
        left = -1
        right = 10 ** 4 * 2

        while right - left > 1:
            mid = left + (right - left) // 2
            if isOK(mid, B):
                right = mid
            else:
                left = mid

        return right
    

    for B in range(-10**4, 10**4+1):
        A = bin_search(B)

        if A**5 - B**5 == X:
            print(A, B)
            exit()


if __name__ == "__main__":
    main()

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


def get_yakusu(P):
    yakusu = []
    for i in range(1, int(math.sqrt(P))+1):
        if P % i == 0:
            yakusu.append(i)
            if i != int(P / i):
                yakusu.append(int(P / i))
    return yakusu


X_yakusu = get_yakusu(X)

flag = False
K = max(int(10 ** 1.4), int((10 ** 9 / 5) ** 0.25)) + 2
for A in range(0, K):
    if flag:
        break
    for x in X_yakusu:
        B = A - x
        if A ** 5 - B ** 5 == X:
            print(A, B)
            flag = True
            break

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

import math

for a in range(-int(math.pow(x,1./3.)),int(math.pow(x,1./3.))+1):
    for b in range(-int(math.pow(x,1./3.))+1,int(math.pow(x,1./3.))+1):
        if a!=b:
            if x/(a-b) == a*a*a*a+a*a*a*b+a*a*b*b+a*b*b*b+b*b*b*b:
                print(a,b)
                break
    else:
        continue
    break