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
input = sys.stdin.readline

import math
from collections import deque
from fractions import gcd
from functools import lru_cache






MOD = 10**9+7
INF = float('inf')






def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]


def inv(n): return pow(n, MOD-2, MOD)


kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr


def lcm(a, b):
    return a * b // gcd (a, b)





X = inputI()

def sign(i):
  if i>=0:
    return 1
  else:
    return -1
  
l = [pow(i,5) for i in range(-500,500)]

for i in l:
  for j in l:
    if i-j == X:
      print(int(pow(abs(i),0.2)*sign(i)) ,int(pow(abs(j),0.2)*sign(j)))
      exit()

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

Solution (Python):


import sys

LIMIT = 10 ** 9
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

divs = make_divisors(X)
for div in divs:
    x = X / div
    for a in range(0, 100000):
        b = a - div
        t = (a ** 4 + (a ** 3) * b + (a ** 2) * (b ** 2) + a * (b ** 3) + b ** 4)

        if t == x:
            print(a, b)
            sys.exit()

Solution (Python):
X =int(input())
A =[i**5 for i in range(1,121)]
a =[i for i in range(1,120)]
B =[i**5 for i in range(-120,121)]
b =[i for i in range(-120,121)]

flg =False
for i in range(len(A)):
    for j in range(len(B)):
        if A[i]  -  B[j]  == X:
            print("{} {}".format(a[i],b[j]))
            flg =True
            break
    if flg:
        break

Solution (Python):
import sys
import numpy as np
x = int(input())
a = np.arange(1500)
a = np.power(a, 5)

for i in range(1500):
    for j in range(1500):
        if (a[i] + a[j]) == x:
            tmp = i
            i = j
            j = -tmp
            print(i, j)
            sys.exit()
        elif (a[i] - a[j]) == x:
            print(i, j)
            sys.exit()

Solution (Python):
import math

X = int(input())
yaku = []

def nibu(a):
  small = -a//2-1
  big = 10**10
  while big-small > 1:
    mid = (small+big)//2
    isx = (mid+a)**5 - mid**5
    if isx > X:
      big = mid
    elif isx < X:
      small = mid
    else:
      print(mid+a,mid)
      exit()

for i in range(1,int(X**0.5+1)):
  if X%i == 0:
    yaku.append(i)
    yaku.append(X//i)
    
for el in yaku:
  nibu(el)

Solution (Python):
import sys
x=int(input())
div=[]
for i in range(1,int(x**0.5)+1):
  if x%i==0:
    div.append(i)
    if i != x // i:
      div.append(x//i)
div.sort()
div.reverse()
for i in div:
  for j in range(-10,1000):
    a=i-i+j
    b=-i+j
    other=(a**4)+(a**3)*b+(a**2)*(b**2)+a*(b**3)+(b**4)
    if i*other==x:
      print(a,b)
      sys.exit()

Solution (Python):
import sys
from io import StringIO
import unittest
import math

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

    a = math.floor(x ** 0.2) + 1

    b5 = a ** 5 - x

    if x == 1:
        a = 0
        b = -1
    elif b5 == 0:
        b = 0
    else:
        right = (10 ** 9)
        left = -1 * (10 ** 9)
        pre_right = (10 ** 9)
        pre_left = -1 * (10 ** 9)

        b = 0
        pre_mid = 10 ** 9
        while 1:
            mid = (right + left) // 2
            ans = mid ** 5
            

            if ans > b5:
                right = mid - 1
            elif ans < b5:
                left = mid + 1
            else:
                b = mid
                break

            if [pre_right, pre_left] == [right, left]:
                a -= 1
                b5 = a ** 5 - x
                right = (10 ** 9)
                left = -1 * (10 ** 9)

            pre_right = right
            pre_left = left

    print(a, b, sep=' ')


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """33"""
        output = """2 -1"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """1"""
        output = """0 -1"""
        self.assertIO(input, output)

if __name__ == "__main__":
    
    resolve()

Solution (Python):
import math

def main():
    X = int(input())
    kazu = int(math.sqrt(X)) + 1

    for index in range(-kazu-1,kazu+1):
        B = index
        A5 = B**5 + X
        if(A5 < 0):
            continue
        A = math.pow(A5, (1.0/5.0))
        if int(A)**5 - B**5 == X :
            print (str(int(A)) +" "+  str(B))
            break



if __name__ == '__main__':
    main()

Solution (Python):
import itertools


max_num = 200
num_list = [i for i in range(-max_num,  max_num+1)]
num_comb = list(itertools.permutations(num_list, 2))

x = int(input().strip())
for comb in num_comb:
    a = comb[0]
    b = comb[1]
    
    a5 = a ** 5
    b5 = b ** 5
    if a5 - b5 == x:
        print(a, b)
        break

Solution (Python):
X=int(input())
N=10**3
i=-1000
res=[]

while(i<N):
  j=-1000
  while(j<N):
    if(i**5 - j**5==X):
      res.append(i)
      res.append(j)
      break
    j+=1
  if(1<len(res)):
    break
  i+=1

print(str(res[0])+" " +str(res[1]))

Solution (Python):






import sys
input = sys.stdin.readline

import math
from collections import deque
from fractions import gcd
from functools import lru_cache






MOD = 10**9+7
INF = float('inf')






def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]


def inv(n): return pow(n, MOD-2, MOD)


kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr


def lcm(a, b):
    return a * b // gcd (a, b)





X = inputI()

l = [pow(i,5) for i in range(-500,500)]

for i in l:
  for j in l:
    if i-j == X:
      if i!=0 and j!= 0:
        print(int(pow(abs(i),0.2)*i/abs(i)) ,int(pow(abs(j),0.2)*j/abs(j)))
        exit()
      elif i==0 and j!=0:
        print(0 ,int(pow(abs(j),0.2)*j/abs(j)))
        exit()
      elif i!=0 and j==0:
        print(int(pow(abs(i),0.2)*i/abs(i)) ,0)
        exit()
      else:
        print(0,0)
        exit()

Solution (Python):
x = int(input())
for a in range(-10000, 10001):
    p = a ** 5
    l, r = -10000, 10001
    while r - l > 1:
        m = (l + r) // 2
        if m ** 5 <= p - x:
            l = m
        else:
            r = m
    if l ** 5 == p - x:
        print(a, l)
        exit(0)

Solution (Python):
import sys
x = int(input())
a = []
b = []
t = 0
for i in range(-1000,1000):
    t = i**5
    a.append([t,i])
    b.append([t,i])
    
for i in a:
    for j in b:
        if i[0]-j[0] == x:
            print(i[1],j[1])
            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

tmp = make_divisors(x)
l = len(tmp) // 2


ans=0

for i in range(l):
  flg = 0
  a=tmp[2*i]
  b=0
  while flg == 0:
    t = a**4 + a**3 * b + a**2 * b**2 + a * b**3 + b**4
    
    if t == tmp[2*i+1]:
      ans=[a,b]
      flg=1
    if t > tmp[2*i+1]:
      flg=2
    a += 1
    b += 1

  a=tmp[2*i]
  b=0
  c=a**4 + a**3 * b + a**2 * b**2 + a * b**3 + b**4
  while flg == 2:
    t=a**4 + a**3 * b + a**2 * b**2 + a * b**3 + b**4
    
    if t == tmp[2*i+1]:
      ans=[a,b]
      flg=1
    if t > c:
      flg=3
    a -= 1
    b -= 1
  
  if flg==1:
    break

if x==1:
  print(0,-1)
else:
  print(ans[0],ans[1])

Solution (Python):
import sys
X = int(input())
for i in range(1,int(X**(0.5)+1)):
    if X % i ==0:
        a=0
        b=-i
        while a**5<X**2:
            a+=1
            b+=1
            if a**5-b**5==X:
                print(a,b)
                sys.exit()

Solution (Python):


import sys
import math
import bisect

debug = False

def log(text):
    if debug:
        print(text)


def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        
        
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]
    
    (x, ) = [int(e) for e in lines[0].split(' ')]

    return (x, )


def solve(x):

    result = [0, 0]
    memo = dict()
    for a in range(-1000, 1001):
        if a in memo:
            aa = memo[a]
        else:
            aa = a**5
            memo[a] = aa

        for b in range(-1000, 1001):
            if b in memo:
                bb = memo[b]
            else:
                bb = b**5
                memo[b] = bb 

            if aa - bb == x:
                result = [a, b]

    return result

def main():
    
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':
  
    main()

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

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

Solution (Python):
from sys import stdin

[X] = [int(x) for x in stdin.readline().rstrip().split()]

s = {}

for i in range(100000):
    r = i * i * i * i * i
    s[r] = i

for i in range(100000):
    r = i * i * i * i * i
    if X < r:
        if not (r - X) in s:
            continue
        print(str(i) + " " + str(s[r - X]))
        break
    else:
        if not (X - r) in s:
            continue
        print(str(i) + " " + str(-s[X - r]))
        break

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

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

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

def rt5(a):
  if a==0:
    return 0
  i=1
  while 1:
    s=i**5
    if a==s:
      return i
    elif a==-s:
      return -i
    elif abs(a)<s:
      return False
    i+=1

b=0

while 1:
  a5=x+b**5
  a=rt5(a5)
  if a==False:
    pass
  else:
    print(a,b)
    exit()
  
  a5=x-b**5
  a=rt5(a5)
  if a==False:
    pass
  else:
    print(a,-b)
    exit()
  b+=1

Solution (Python):
x = int(input())
p, q = 0, 0
for a in range(-121, 121):
    for b in range(-121, 121):
        if a**5 - b**5 == x:
            p, q = a, b
            break
print(p, q)

Solution (Python):
x=int(input())
up=0
for i in range(1000):
    if (i+1)**5-i**5>10**9:
        up=i
        break
for a in range(-up-1,up+1):
    for b in range(-up-1,up+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)

    
    return divisors
li = make_divisors(x)



for l in li:
    for k in range(-1000,1000):
        b = k
        a = b + l
        if a**4 +a**3*b +(a**2)*(b**2)+a*(b**3)+b**4 == x//l:
            print(a,b)
            exit()

Solution (Python):
X = int(input())
five = [0] * 200
five_inv = [0] * 200
for i in range(200):
  five[i] = i ** 5
  five_inv[i] = -five[i]

def check(x):
  A = 0
  B = 0
  for i in range(200):
    if X + five[i] in five:
      B = i
      A = five.index(five[i] + X)
      break
    elif X - five[i] in five:
      B = -i
      A = five.index(-five[i] + X)
      break
    elif X - five[i] in five_inv:
      B = -i
      A = -five_inv.index(-five[i] + X)
      break
  return "{} {}".format(A,B)

print(check(X))

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

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

Solution (Python):
X=int(input())
ans=[]
for i in range(1,150):
  for j in range(-150,150):
    if((i**5)-(j**5)==X):
      ans.append((str(i)+" "+str(j)))
print(ans[0])

Solution (Python):
x = int(input())
flag = True
for a in range(-500, 500):
    for b in range(-500, 500):
        if a ** 5 - b ** 5 == x:
            print(' '.join([str(a), str(b)]))
            flag = False
            break
    if not flag:
        break

Solution (Python):


import sys
input= lambda: sys.stdin.readline().rstrip()
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))

def resolve():
    X,=pin()


    
    for a in range(1000):
        cond=0        
        if a**5==X:print(a,0);break
        
        A=a
        if A**5<X:
            t=X-A**5
            cond=1
            r=A+1 
        elif A**5>X:
            t=(A**5)-X
            r=100+A+1
        
        
        for b in range(r):                
            
            if b**5==t:
                
                B=b
                if cond==1:B*=(-1)
                print(A,B)
                return
                

resolve()

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

for a in range(1, 1500):
    a4 = a**4
    a3 = a**3
    a2 = a**2
    for b in range(-1500, 1500):
        an = (a-b)*(a4 + (a3)*b + (a2)*(b**2) + a*(b**3) + b**4)
        if an < 0:
            break

        if an == X:
            print(a, b)
            exit()

Solution (Python):
X = int(input())
fives = list(i**5 for i in range(1000))
for i, five in enumerate(fives):
    if five-X in fives:
        print(i, fives.index(five-X))
        break
    if X-five in fives:
        print(fives.index(X-five), -i)
        break

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

def calc(x):
    for a in range(0,100000):
        for b in range(-1000,1000):
            if(f(a,b)==x):
                print(a,b)
                return 0;
x = int(input())
calc(x)

Solution (Python):
X=int(input())
J=1000
N=[0]*J
for i in range(0,J):
    N[i]=i**5
for i in range(0,J):
    for j in range(0,J):
        if abs(N[i]-N[j])==X:
            print(int(max(N[i],N[j])**(1/5)),int(min(N[i],N[j])**(1/5)))
            exit()
        elif N[i]+N[j]==X:
            print(int(N[i]**(1/5)),int(-1*N[j]**(1/5)))
            exit()

Solution (Python):
import sys
sys.setrecursionlimit(10000000)

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 sorted(divisors)


def main():
    X = int(input())
    divisors = make_divisors(X)
    root_X = int(X ** 0.5)
    for d in divisors:
        lim = int(X ** 0.25)
        for b in range(-lim, lim+1):
            a = b + d
            if a ** 4 + (a**3) * b + (a ** 2) * (b** 2) + (a) * (b ** 3) + b ** 4 == X // d:
                print(a, b)
                sys.exit()
        

if __name__ == '__main__':
    main()

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

notsolved = True
for a in range(-500, 500):
    if notsolved:
        for b in range(-500, 500):
            if a**5-b**5 < x:
                continue
            if a**5-b**5 == x:
                print(str(a)+" "+str(b))
                notsolved = False

Solution (Python):
import itertools

x = int(input())

y = itertools.combinations(range(-1000,1000), 2)
for n in y:
    if (n[0]**5 - n[1]**5) == x:
        print(n[0], n[1])
        break
    elif (n[1]**5 - n[0]**5) == x:
        print(n[1], n[0])
        break

Solution (Python):

X = int(input())

ans = ""
for i in range(10 ** 4):
    for j in range(-70, i, 1):
        if i ** 5 - j ** 5 == X:
            ans = "{} {}".format(i, j)
            break
    if ans != "":
        break

if ans != "":
    print(ans)
else:
    print(aaa)

Solution (Python):
import sys

X = int(sys.stdin.readline())

temp = [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,
328080401001,
336323216032,
344730881243,
353305857024,
362050628125,
370967703776,
380059617807,
389328928768,
398778220049,
408410100000,
418227202051,
428232184832,
438427732293,
448816553824,
459401384375,
470184984576,
481170140857,
492359665568,
503756397099,
515363200000,
527182965101,
539218609632,
551473077343,
563949338624,
576650390625,
589579257376,
602738989907,
616132666368,
629763392149,
643634300000,
657748550151,
672109330432,
686719856393,
701583371424,
716703146875,
732082482176,
747724704957,
763633171168,
779811265199,
796262400000,
812990017201,
829997587232,
847288609443,
864866612224,
882735153125,
900897818976,
919358226007,
938120019968,
957186876249,
976562500000,
996250626251,
1016255020032,
1036579476493,
1057227821024,
1078203909375,
1099511627776,
1121154893057,
1143137652768,
1165463885299,
1188137600000,
1211162837301,
1234543668832,
1258284197543,
1282388557824,
1306860915625,
1331705468576,
1356926446107,
1382528109568,
1408514752349,
1434890700000,
1461660310351,
1488827973632,
1516398112593,
1544375182624,
1572763671875,
1601568101376,
1630793025157,
1660443030368,
1690522737399,
1721036800000,
1751989905401,
1783386774432,
1815232161643,
1847530855424,
1880287678125,
1913507486176,
1947195170207,
1981355655168,
2015993900449,
2051114900000,
2086723682451,
2122825311232,
2159424884693,
2196527536224,
2234138434375,
2272262782976,
2310905821257,
2350072823968,
2389769101499,
2430000000000,
2470770901501,
2512087224032,
2553954421743,
2596377985024,
2639363440625,
2682916351776,
2727042318307,
2771746976768,
2817036000549,
2862915100000,
2909390022551,
2956466552832,
3004150512793,
3052447761824,
3101364196875,
3150905752576,
3201078401357,
3251888153568,
3303341057599,
3355443200000,
3408200705601,
3461619737632,
3515706497843,
3570467226624,
3625908203125,
3682035745376,
3738856210407,
3796375994368,
3854601532649,
3913539300000,
3973195810651,
4033577618432,
4094691316893,
4156543539424,
4219140959375,
4282490290176,
4346598285457,
4411471739168,
4477117485699,
4543542400000,
4610753397701,
4678757435232,
4747561509943,
4817172660224,
4887597965625,
4958844546976,
5030919566507,
5103830227968,
5177583776749,
5252187500000,
5327648726751,
5403974828032,
5481173216993,
5559251349024,
5638216721875,
5718076875776,
5798839393557,
5880511900768,
5963102065799,
6046617600000,
6131066257801,
6216455836832,
6302794178043,
6390089165824,
6478348728125,
6567580836576,
6657793506607,
6748994797568,
6841192812849,
6934395700000,
7028611650851,
7123848901632,
7220115733093,
7317420470624,
7415771484375,
7515177189376,
7615646045657,
7717186558368,
7819807277899,
7923516800000,
8028323765901,
8134236862432,
8241264822143,
8349416423424,
8458700490625,
8569125894176,
8680701550707,
8793436423168,
8907339520949,
9022419900000,
9138686662951,
9256148959232,
9374815985193,
9494696984224,
9615801246875,
9738138110976,
9861716961757,
9986547231968,
10112638401999,
10240000000000,
10368641602001,
10498572832032,
10629803362243,
10762342913024,
10896201253125,
11031388199776,
11167913618807,
11305787424768,
11445019581049,
11585620100000,
11727599043051,
11870966520832,
12015732693293,
12161907769824,
12309502009375,
12458525720576,
12608989261857,
12760903041568,
12914277518099,
13069123200000,
13225450646101,
13383270465632,
13542593318343,
13703429914624,
13865791015625,
14029687433376,
14195130030907,
14362129722368,
14530697473149,
14700844300000,
14872581271151,
15045919506432,
15220870177393,
15397444507424,
15575653771875,
15755509298176,
15937022465957,
16120204707168,
16305067506199,
16491622400000,
16679880978201,
16869854883232,
17061555810443,
17254995508224,
17450185778125,
17647138474976,
17845865507007,
18046378835968,
18248690477249,
18452812500000,
18658757027251,
18866536236032,
19076162357493,
19287647677024,
19501004534375,
19716245323776,
19933382494057,
20152428548768,
20373396046299,
20596297600000,
20821145878301,
21047953604832,
21276733558543,
21507498573824,
21740261540625,
21975035404576,
22211833167107,
22450667885568,
22691552673349,
22934500700000,
23179525191351,
23426639429632,
23675856753593,
23927190558624,
24180654296875,
24436261477376,
24694025666157,
24953960486368,
25216079618399,
25480396800000,
25746925826401,
26015680550432,
26286674882643,
26559922791424,
26835438303125,
27113235502176,
27393328531207,
27675731591168,
27960458941449,
28247524900000,
28536943843451,
28828730207232,
29122898485693,
29419463232224,
29718439059375,
30019840638976,
30323682702257,
30629980039968,
30938747502499]

for i, x in enumerate(temp):
    
    for j, y in enumerate(temp):
        if x - y == X:
            print(i, j)
            exit()
    temp_x = temp[i-1]
    for j, y in enumerate(temp):
        if temp_x + y == X:
            print(i-1, -j)
            exit()

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

c = []
for i in range(1, int((X+1)**(1/2))+1):
    if i != 0 and X % i == 0:
        c.append([i, X//i])

for x1, x2 in c:
    for b in range(-1000, 1000):
        if b != 0:
            if (x1+b)**3 * (2*b+x1) + (b**2) * (x1**2 + 3*x1*b+3*(b**2)) == x2:
                print(x1+b, b)
                break

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

for b in range(-200, 200):
    for a in range(200):
        if a**5 == X + b**5:
            ans =(a, b)
            break
print(*ans)

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

for b in range(0, -1000, -1):
    for a in range(100, -1000, -1):
        if (a ** 5 - b ** 5) == X:
            print(a, b)
            sys.exit()

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

lst = [i**5 for i in range(0, 10000)]
comb = itertools.combinations(lst, 2)
for i in comb:
    if i[0]-i[1] == X:
        a = math.pow(i[0], 1/5)
        b = math.pow(i[1], 1/5)
        print("{} {}".format(int(a), int(b)))
        break
    elif i[0]+i[1] == X:
        a = math.pow(i[0], 1/5)
        b = -math.pow(i[1], 1/5)
        print("{} {}".format(int(a), int(b)))
        break
    elif -i[0]-i[1] == X:
        a = -math.pow(i[0], 1/5)
        b = math.pow(i[1], 1/5)
        print("{} {}".format(int(a), int(b)))
        break
    elif -i[0]+i[1] == X:
        a = -math.pow(i[0], 1/5)
        b = -math.pow(i[1], 1/5)
        print("{} {}".format(int(a), int(b)))
        break

Solution (Python):
X = int(input())
for B in range(131):
    for A in range(B,131):
        if A**5 - B**5 == X:
            print(str(A) + " " + str(B))
            exit()
        elif A**5 + B**5 == X:
            print(str(A) + " " + str(-1*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

yakusu = make_divisors(X)
for k in yakusu:
    for A in range(-1000, 1000):
        B = A-k
        if A**4 + (A**3)*B + (A**2)*(B**2) + A*(B**3) + B**4 == X/k:
            print(A, B)
            break

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

flag=0
for i in range(-121,400):
  for j in range(0,150):
    n=j**5-((i)**5)
    
    if n==x:
      flag=1
      a=j
      b=i
      break
  if flag==1:
    break
print(a,b)

Solution (Python):
import sys

s = int(input())


N=1000
d=[0]*N


for i in range(N):
  d[i]=i**5
  
for i in range(N):
  for j in range(i,N):
    if (d[i] + d[j] == s) :
      print(i,-j)
      sys.exit
    elif (d[i] - d[j] == s):
      print(i,j)
      sys.exit
    elif (d[j] + d[i] == s):
      print(j,-i)
      sys.exit
    elif (d[j] - d[i] == s):
      print(j,i)
      sys.exit

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

a = 0
while True:
	t = abs(a**5-x)
	s = 0
	c = 0
	while s<t:
		c += 1
		s = c**5
	
	if s == t:
		b = int(c*((a**5-x)/t))
		break
	a += 1

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

Solution (Python):
def main():
    x=int(input())
    for i in range(1000):
        for j in range(-1000,1000):
            if pow(i,5)-pow(j,5)==x:
                print(str(i)+" "+str(j))
                exit()

if __name__ =='__main__':
    main()

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

memo = [0]
i = 1
while(pow(i, 5) < 10**18):
  memo.append(pow(i, 5))
  i+=1
  
  
for i in range(len(memo)):
  for j in range(len(memo)):
    if memo[i]-memo[j] == x:
      print(i, j)
      exit()
    if memo[i]+memo[j]  == x:
      print(i, -j)
      exit()

Solution (Python):

X = int(input().strip())


def solve():
    nums = [i ** 5 for i in range(-1000, 1000)]
    ans = set()
    for A in nums:
        for B in nums:
            if A - B == X:
                a = 0 if A == 0 else int(A / abs(A) * (abs(A) ** 0.2))
                b = 0 if B == 0 else int(B / abs(B) * (abs(B) ** 0.2))
                print(a, b)
                exit()

solve()

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 = input()
X = int(x)

div = make_divisors(X)

for item in div:
    for A in range(-1000,1000):
        B = A - item

        if A**5 - B**5 == X:
            print(str(A) + " " + str(B))
            break
        else:
            continue
        break