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 math

X = int(input())



def calculate(x):

    b = 0
    while True:
        tmp1 = x + b ** 5
        a1 = math.pow(tmp1, 0.2)

        if (a1 - math.floor(a1) < 1e-7):
            print(int(a1), int(b))
            break

        tmp2 = x + (-1 * b) ** 5
        if tmp2 >= 0:
            a2 = math.pow(tmp2, 0.2)
            if (a2 - math.floor(a2) < 1e-7):
                print(int(a2), int(-1 * b))
                break

        b = b + 1


calculate(X)

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

a = [i**5 for i in range(0, 300)]

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

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






flag = False
for a in range(1000):
    for b in range(-1000,1000):
        if a-b == 0:
            break
        if X%(a-b) == 0 and a**5 - b**5 == X:
                flag = True
        if flag:
            break
    if flag:
        break
print(str(a) + ' ' + str(b))

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

CNT = 500

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

Solution (Python):



def ri():
    return int(input())

def rl():
    return list(input().split())

def rli():
    return list(map(int, input().split()))

def main():
    inf = 1e9
    x = ri()
    n = 0
    nums = dict()
    bef = 0
    while True:
        p = n**5
        if p - bef > 2*inf:
            break
        nums[p] = n
        nums[-p] = -n
        bef = p
        n += 1
    for i in range(n+1):
        p = i**5
        if x+p in nums:
            print(nums[x+p],i)
            return
        if x-p in nums:
            print(nums[x-p],-i)
            return


if __name__ == '__main__':
    main()

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

flag = False
for i in range(150):
    for j in range(150):
        if i**5 - j**5 == X:
            print(i,j)
            flag = True
            break
        if (-i)**5 - j**5 == X:
            print(-i,j)
            flag = True
            break
        if i**5 - (-j)**5 == X:
            print(i,-j)
            flag = True
            break
        if (-i)**5 - (-j)**5 == X:
            print(-i,-j)
            flag = True
            break
    if flag:
        break

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

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

Solution (Python):
X=int(input())
a=1
while a<1001:
    for i in range(-1000,1001):
        if a**5-i**5==X:
            b=i
            print(a,b)
            exit()
    a+=1

Solution (Python):
def I(): return int(input())
X = I()
kouho = []
for i in range(1000):
    kouho.append(i**5)
for a in kouho:
    for b in kouho:
        if a<b:
            continue
        if a+b==X:
            print(int(a**(1/5)),int(-b**(1/5)))
            break
        if a-b==X:
            print(int(a**(1/5)),int(b**(1/5)))
            break

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


for i in range(10001):
    for j in range(10001):
        if i**5 + j**5 ==X:
            x=max(i,j)
            y=min(i,j)
            print(x, -y)
            exit()
        if i**5 - j**5 ==X:
            x=max(i,j)
            y=min(i,j)
            print(x, y)
            exit()

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

while (5*a**4+10*a**3+5*a**2+1 < X):
    a = a + 1

I = [i for i in range(-a,a+1)]

flag = 0

for i in I:
    for j in range(-a,i+1):
        if (i**5 - j**5 == X):
            print("%d %d" % (i, j))
            flag = 1
    if (flag):
        break

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

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

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

for A in range(-500,500):
    for B in list(range(-500,500)):
        if A**5 - B**5 == X:
            print(f'{A} {B}')
            exit()

Solution (Python):
x=int(input())
c=0
for i in range(0,501):
    for j in range(0,501):
        if (i*i*i*i*i)+(j*j*j*j*j)==x:
            print(i,"-"+str(j))
            c+=1
            break
        elif (i*i*i*i*i)-(j*j*j*j*j)==x:
            print(i,j)
            c+=1
            break
    if c==1:
        break

Solution (Python):
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)
for p in div:
    i = 0
    while (i+p-p//2)**5 - (i-p//2) ** 5 <= X:
        if (i+p-p//2)**5 - (i-p//2) ** 5 == X:
            print(i+p-p//2, i-p//2)
            break
        i += 1
    else:
        continue
    break
    i = 0
    while (i+p)**5 - i ** 5 <= X:
        if (i+p)**5 - i ** 5 == X:
            print(i+p, i)
            break
        i += 1
    else:
        continue
    break

Solution (Python):
import sys
X = int(input())
for i in range(-300,300):
    for j in range(-300,300):
        if i**5-j**5 == X:
            print("{0} {1}".format(i,j))
            sys.exit(0)

Solution (Python):
import math
import numpy as np
x = int(input())
for i in range(1, 10**6):
	b_tmp = np.power(i, 5) - x
	b = round(np.power(max(b_tmp, -b_tmp), 0.2), 10)
	if float.is_integer(b):
		if b_tmp < 0:
			print(i, int(-b))
			break
		else:
			print(i, int(b))
			break

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 d in divisors:
  b = - int(x**(1/5)) - 1
  f = False
  while True:
    if (b+d)**5 - b**5 == x:
      f = True
      break
    elif (b+d)**5 - b**5 > x and b > 0:
      break
    b += 1
  if f:
    print(b+d, b)
    break

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

A = []
for i in range(1000):
    A.append(i ** 5)

x, y = 0, 0

flag = False
for i, a in enumerate(A):
    for j, b in enumerate(A[i+1:]):
        if b - a == X:
            flag = True
            x = j + i + 1
            y = i
            break
        if a + b == X:
            flag = True
            x = i
            y = -(j + i + 1)
            break
    if flag:
        break
print(x, y)

Solution (Python):















mod = int(1e9+7)
INF = 1<<29
lINF = 1<<35

def readInt():
    return list(map(int,input().split()))

def main():
    x = int(input())
    a = 0
    bl = -1000
    br = 1000
    b = False
    while not b:
        z = a**5
        bl = -1000
        br = 1000
        while abs(bl-br)!=1:
            if z-((bl+br)//2)**5<x:
                br = (bl+br)//2
            elif z-((bl+br)//2)**5>x:
                bl = (bl+br)//2
            if z-((bl+br)//2)**5==x:
                b = (bl+br)//2
                break
        if not b:
            a += 1
    print(a,b)
    return

if __name__=='__main__':
    main()

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

a = 0
b = 0
while True :
    b1 = 0
    b2 = 0
    y = a**5-x
    if y>0 :
        z = float(y)**0.2
        b1 = int(z)
        b2 = int(z) + 1
    elif y<0 :
        z = -((-float(y))**0.2)
        b1 = int(z)
        b2 = int(z) -1
    else :
        break

    if y==b1**5 :
        b = b1
        break
    elif y==b2**5 :
        b = b2
        break
    else :
        a = -a
        if a>=0 :
            a += 1
        
print(a,b)

Solution (Python):
X = int(input())
flag=1
for A in range(-500,500):
    for B in range(-500,500):
        if(A**5-B**5==X):
            print(A,B)
            break
    else:
        continue
    break

Solution (Python):
import itertools
x = int(input())
digits = len(str(x))
dic = {}
keta = []
for i in range(121):
    num = i ** 5    
    if (num > 10**(digits+2)):
        break
    if num > 10**(digits-2):
        dic[i] = num
        dic[-i] = -num
    elif num < 10**(digits+1):
        dic[i] = num
        dic[-i] = -num
        
for num1,num2 in itertools.combinations(dic.keys(), 2):
    a, b = dic[num1], dic[num2]
    if x == (a-b):
        ans = (num1,num2)
        break
    if x == (-a+b):
        ans = (num2,num1)
        break
print(f"{ans[0]} {ans[1]}")

Solution (Python):
def find(n):
  dif = 0
  i = 0
  while dif <=n:
    i+=1
    dif=i**5-(i-1)**5
  return i


X= int(input())
lim = find(X)
condition = True
for i in range(lim):
  if condition:
    puissance = i**5-X
    signe = (abs(puissance)//puissance)
    entier = int(((puissance*signe)**(1/5)))
    if entier**5 == signe*puissance:
      print(i, entier*signe)
      condition = False

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

c = 1
result = False


while not result:
    for i in range(c):
        a = c -i
        b = i
        if a**5 - b**5 == X:
            result = True
            A = a
            B = b
            break
    if result == True:
        break
    for i in range(c):
        b = c - i
        a = - i
        if a**5 - b**5 == X:
            result = True
            A = a
            B = b
            break
    if result == True:
        break
    for i in range(c):
        a = -c+i
        b = -i
        if a**5 - b**5 == X:
            result = True
            A = a
            B = b
            break
    if result == True:
        break
    for i in range(c):
        a = i
        b = -c + i
        if a**5 - b**5 == X:
            result = True
            A = a
            B = b
            break
    if result == True:
        break
    c += 1

print(A, B)

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

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

Solution (Python):
import numpy as np
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            
            

    
    return divisors




X = int(input())

div = make_divisors(X)

for diff in div:
    for a in range(int(X**0.5)):
        if (a**5 - (a-diff)**5) == X:
            print(a, a-diff)
            break

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

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

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

al = [i**5 for i in range(0, 1001)]
bl = [i**5 for i in range(0, 1001)]

for i in bl:
    a1 = x - i
    a2 = x + i
    if a1 in al:
        print(al.index(a1), - (bl.index(i)))
        exit()
    if a2 in al:
        print(al.index(a2), bl.index(i))
        exit()

Solution (Python):
x=int(input())
a=0
while True:
    g=a**5
    c=g-x
    b=(abs(c))**(0.2)
    b=round(b)
    if abs(c)-b**5==0:
        b=round(b)
        if c<0:
            b=-b
        break
    a+=1
print(a, b)

Solution (Python):
import sys

x=int(input())
for a in range(10**3):
    for b in range(10**3):
        if a**5 - b**5==x:
            print(a,b)
            sys.exit()
        if (-a)**5 - b**5==x:
            print(-a,b)
            sys.exit()
        if a**5 - (-b)**5==x:
            print(a,-b)
            sys.exit()
        if (-a)**5 - (-b)**5==x:
            print(-a,-b)
            sys.exit()

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):
import logging

logging.basicConfig(level=logging.INFO, format="%(message)s")


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

    logging.info("error")
        
            
if __name__ == "__main__":
    main()

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

Solution (Python):
import sys

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

Solution (Python):
x = int(input())
A=[]
i=1
while i*i<=x:
  if x%i==0:
    A += [i, x//i]
  i += 1
for j in A:
  c= j//2
  a = c
  while a**5-(a-j)**5 < x:
    a +=1
  else:
    if a**5-(a-j)**5 == x:
      print(a,a-j)
      break

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

x = int(input())

m = 500
aa = [0]*(m*2)
for i in range(-m,m):
    j = -m+i
    aa[j] = i**5

for i in range(m*2):
    for j in range(m*2):
        if aa[i] - aa[j] == x:
            print(-m+i,-m+j)
            exit()

Solution (Python):




import sys
from io import StringIO
import unittest

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline
    x=int(readline())
    to=1001
    memo=[0]*to
    
    for i in range(to):
        memo[i]=i**5

    a=0
    b=0
    if x==0:
        print(a,b)
        return

    for i in range(to):
        z1=x-memo[i]
        z2=memo[i]-x
        if z1 in memo:
            a=i
            for j in range(to):
                if memo[j]==z1:
                    b=j*-1
            break
        if z2 in memo:
            a=i
            for j in range(to):
                if memo[j]==z2:
                    b=j
            break
    
    
    
    print(a,b)
    return
    
    b=1000**5
    for i in range(1001,100000000):
        a=b
        b=i**5
        if (b-a)==x:
            print(i,(i-1))
            return

    return

if 'doTest' not in globals():
    resolve()
    sys.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())
div = make_divisors(x)

if x == 1: print("0 -1")

for i in range(len(div)//2):
    u = div[i*2]
    if len(div)%2 == 1: v = div[i*2]
    else: v = div[i*2+1]
    t = int(v**(1/2))
    for j in range(t):
        a = j
        b = j-u
        if a**4 + (a**3)*b +(a**2)*(b**2) + a*(b**3) + b**4 == v:
            print(a, b)
            break

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

Solution (Python):
import numpy as np
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            
                
    return divisors
n = int(input())
a_b = sorted(make_divisors(n))
flag = False
for i in a_b:
  if i ** 5 == n:
    print(i, 0)
    break
  else:
    for b in range(-int(np.sqrt(n)), int(np.sqrt(n + 1))):
      if (i+b)**5-b**5 == n:
        print(i + b, b)
        flag = True
        break
  if flag:
    break

Solution (Python):

x = (int)(input())

flg = False
if x >= 0:
    for i in range(0, x + 1):
        for j in range(-i - 1, i + 1):
            if i ** 5 - j ** 5 == x:
                flg = True
                break

        if flg:
            print(str(i) + " " + str(j))
            break
else:
    for i in range(0, x + 1):
        for j in range(-i - 1, i + 1):
            if i ** 5 - j ** 5 == x:
                flg = True
                break

        if flg:
            print(str(j) + " " + str(i))
            break

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

for i in range(2*10**2):
    for j in list(range(-i, i)):
        if i**5 - j**5 == x:
            print(i, j)
            break

Solution (Python):
x=int(input())
ans=[]
for a in range(1001):
    for b in range(-1000,1001):
        if a==b==0:
            pass
        else:
            if x%(a**4+a*a*a*b+a*a*b*b+a*b*b*b+b**4)==0:
                if a**5-b**5==x:
                    print(a,b)
                    exit()

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

if __name__=='__main__':
    main()

Solution (Python):
X = int(input())
if X == 0:
  print(0,0)
else:
  for i in range(-121,122):
    for j in range(-121,122):
      if i==j:
        continue
      else:
        if X%(i-j) == 0:
          if X == i**5 - j**5:
            print(i,j)
            exit()

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

a = 1

def f(x, a):
    return 5 * a * (x ** 4) - 10 * (a ** 2) * (x ** 3) + 10 * (a ** 3) * (x ** 2) - 5 * (a ** 4) * x + a ** 5

def df(x, a):
    y = 5 * (x ** 4) + (-20 * a + 10) * (x ** 3) + (30 * (a ** 2) - 30 * a + 10) * (x ** 2) + (-20 * (a ** 3) + 30 * (a ** 2) - 20 * a + 5) * x + 5 * (a ** 4) - 10 * (a ** 3) + 10 * (a ** 2) - 5 * a + 1
    return y

x = 0
a = 1
s = 0
while True:
    s += df(x, a)
    if s == X:
        break
    if s > X:
        x += 1
        a = 0
        s = 0
    a += 1

print(x, x-a)

Solution (Python):
x = int(input())
ans = [i**5 for i in range(200)]
for i in ans:
    for j in ans:
        if i - j == x:
            print(ans.index(i), ans.index(j))
            exit()
        if i + j == x:
            print(ans.index(i), -ans.index(j))
            exit()

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

    
    return divisors

def check_xy(alpha, beta):
    if alpha**2 + 4*beta < 0:
        return []

    x = (alpha + (alpha**2 + 4*beta)**0.5) // 2
    y = - (alpha - (alpha**2 + 4*beta)**0.5) // 2

    if (x - y) == alpha and x*y == beta:
        return [int(x), int(y)]
    else:
        return []


X = int(input())
divisor = get_divisor(X)


def check_beta(alpha, beta):
    if alpha**5 + 5*(alpha**3)*beta + 5*alpha*(beta**2) == X:
        return 1
    else:
        return 0

for alpha in divisor:
    rem = X // alpha
    
    rem -= alpha**4
    
    if rem % 5 != 0:
        continue
    
    rem //= 5
    

    if alpha**4 + 4*rem < 0:
        continue


    o_beta = int(( (alpha**4 + 4*rem)**0.5 - alpha**2) // 2)
    u_beta = int(( -(alpha**4 + 4*rem)**0.5 - alpha**2) // 2)

    

    if check_beta(alpha, o_beta) == 1:
        ans = check_xy(alpha, o_beta)
        
        if len(ans) == 2:
            print(ans[0], ans[1])
            break

    if check_beta(alpha, u_beta) == 1:
        ans = check_xy(alpha, u_beta)

        if len(ans) == 2:
            print(ans[0], ans[1])
            break

Solution (Python):
def main():
    x=int(input())
    for k in range(200):
        for a in range(400):
            if a**5-(a-k)**5==x:
                print(a,a-k)
                exit()
    
if __name__=='__main__':
    
    main()

Solution (Python):
import collections
import sys

def make_divisors(n):  
    divisors = []
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n // i)

    divisors.sort()
    return divisors



X = int(input())

if X == 0:
  print("0 0")
  sys.exit()

x = abs(X)
c = make_divisors(x)
c.append(1)
c = sorted(c)



for i in range(len(c)):
  B = (c[i] // 2) * -1
  A = B + c[i]
  while True:
    Z = A**5 - B**5
    
    if Z == x:
      if X < 0:
        print(B,A)
      else:
        print(A,B)
      sys.exit()

    if Z > x:
      break    
      
    A += 1
    B += 1

Solution (Python):
import sys

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


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

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


if __name__ == '__main__':
    resolve()

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

for n in range(200):
    for i in range(-200,200):
        x=i**5-(i-n)**5
        if x==X:
            print(str(i)+" "+str(i-n))
            break

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

a = 0

while True:
    b5 = a**5 - x
    
    if b5 >= 0:
        for b in range(b5+1):
            if b**5 == b5:
                print(a, b)
                exit()
            if b**5 > b5:
                break
    else:
        b5m = -b5
        for bm in range(b5m+1):
            if bm**5 == b5m:
                print(a, -bm)
                exit()
            if bm**5 > b5m:
                break
    
    a += 1

Solution (Python):
import sys

inputLine=input()
X=int(inputLine)

MIN = -1000
MAX = 1000

for A in range(MIN, MAX+1):
    for B in range(MIN, MAX+1):
        if A**5 - B**5 == X:
            print(A, B)
            sys.exit()

Solution (Python):
x = int(input())
for a in range(800):
    for b in range(-800, 800):
        if (a ** 3 + b ** 3) * (a ** 2 - b ** 2) + (a ** 2) * (b ** 2) * (a - b) == x:
            print(a, b)
            exit()

Solution (Python):


from queue import Queue
from queue import LifoQueue as Stack
from math import sqrt, floor, ceil, log2, log10, pi, pow
from fractions import gcd
from itertools import permutations, combinations
from operator import itemgetter
from functools import cmp_to_key


INF=1001001001
__MOD__=(10**9)+7
yn = 'YNeos'
judge = False
cnt = 0
ans = None


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

def intinput():
    return int(input())

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

def lineinputs(func=intinput):
    datas = []
    while True:
        try:
            datas.append(func())
        except EOFError:
            break
    return datas

class ModInt():
    def __init__(self, x):
        self.__x = (x % __MOD__)
    def __add__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x + other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x + other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __radd__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x + self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x + self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __sub__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x - other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x - other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rsub__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x - self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x - self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __mul__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rmul__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x * self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x * self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __truediv__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__modinv())%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__modinv())%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rtruediv__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x * self.__modinv())%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x * self.__modinv())%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __pow__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__(pow(self.__x, other.__x, __MOD__)))
        elif type(other) == ModInt:
            return self.__class__(pow(self.__x, other.__x, __MOD__))
        else:
            raise Exception("Not Int or Not ModInt")
    def __rpow__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__(pow(other.__x, self.__x, __MOD__)))
        elif type(other) == ModInt:
            return self.__class__(pow(other.__x, self.__x, __MOD__))
        else:
            raise Exception("Not Int or Not ModInt")

    def __modinv(self, m=__MOD__):
        a = self.__x
        if a == 0:
            raise ZeroDivisionError()
        if gcd(a, m) != 1:
            raise Exception("%sの逆数は求まりません。" % a)
        b, u, v = m, 1, 0
        while b != 0:
            t = a//b;
            a -= t*b
            a, b = b, a
            u -= t * v
            u, v = v, u
        u %= m
        if u < 0:
            u += m
        return u
    def __int__(self):
        return self.__x
    def __str__(self):
        return str(self.__x)



if __name__ == '__main__':
    X = intinput()
    digit = 256  
    nums = []
    for i in range(digit+1):
        num = i**5
        nums.append((i, num))
        nums.append((-1*i,-1*num))

    for a in nums:
        for b in nums:
            if a[1] - b[1] == X:
                print(a[0], b[0])
                exit()

Solution (Python):
X = int(input())
flag = 0
A = 0
B = 0
for i in range(0,100000):
  if flag== 1:
    break
  for j in range(i,100000):
    
    x = i**5 + j**5
    
    if x == X:
      A = i
      B = -j
      flag = 1
      break
    elif x > X:
      break
for i in range(1,100000):
  if flag == 1:
    break
  for j in range(0,i):
    x = i**5 - j**5
    if x == X:
      A = i
      B = j
      flag = 1
      break
    elif x < X:
      break
  
      
print("{} {}".format(A,B))

Solution (Python):
x=int(input())
D=[1]
for i in range(2,int(x**0.5)+1):
    if x%i==0:
        D.append(i)
for d in D:
    for i in range(1000):
        if i**5-(i-d)**5==x:
            print(i,i-d)
            exit()

Solution (Python):
def divisors(n, reverse=False):
    table = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            table.append(i)
            if i != n // i:
                table.append(n // i)
    table.sort(reverse=reverse)
    return table

x = int(input())
for div in divisors(x, reverse=True):
    b = -(div//2)
    a = div + b
    exist = False
    i = 0
    while True:
        val = (a+i)**5 - (b+i)**5
        if val == x:
            exist = True
            break
        if val > x:
            break
        i += 1
    if exist:
        print(a+i, b+i)
        break

Solution (Python):
import sys

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

x = int(input())

if x == 1:
    print("1 0")
    sys.exit()

y = (x-1)//5
A = 0
C = 0

while y>C:
    A += 1
    C = (A**4) + (2*(A**3)) + (2*(A**2)) + A


if (A+1)**5-A**5 == x:
    print(str(A+1)+" "+str(A))
    sys.exit()



divs = make_divisors(x)
divs = divs[1:]
for i in divs:
    for j in range(A):
        a = j+1
        b = a-i
        if a**5-b**5 == x:
            print(str(a)+" "+str(b))
            sys.exit()

Solution (Python):
X = int(input())
for i in range(1000):
    for k in range(1000):
        if i**5 + k ** 5 == X:
            print("{} {}".format(i,k*-1))
            quit()
        elif i**5 - k**5 == X:
            print("{} {}".format(i,k))
            quit()

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

    for B in range(0, 1000):
        for A in range(B, 1000):
            if A**5 - B**5 == X:
                print(A, B, sep=" ")
                return
            if A**5 + B**5 == X:
                print(A, -B, sep=" ")
                return

if __name__ == '__main__':
    main()

Solution (Python):

import sys

x =int(input())

app = []
for i in range(0,10000):
    app.append(i**5)

flag = False
store=[]
for i in app:
    for j in app:
        if i - j == x:
            store.append(i**(1/5))
            store.append(j**(1/5))
            flag = True
            break
        elif -i - j == x:
            store.append(i**(1/5))
            store.append(j**(1/5))
            flag = True
            break
        elif -i + j == x:
            store.append(i**(1/5))
            store.append(j**(1/5))
            flag = True
            break
        elif i + j == x:
            store.append(i**(1/5))
            store.append(j**(1/5))
            flag = True
            break
    if flag:
        break

x1 = int(store[0])
y1 = int(store[1])

if (-x1)**5 - y1**5 ==x:
    x1 = x1
    y1 = y1
elif x1**5 - (-y1)**5 ==x:
    x1 = x1
    y1 = -y1
elif (-x1)**5 - (-y1)**5 ==x:
    x1 = -x1
    y1 = -y1
    
print(str(x1) + " " +str(y1) )

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

L = [0] * (2 * 10**4 + 3)
for a in range(-10**4, 10**4 + 1):
    L[a + 10**4] = a**5


for a in range(-10**3, 10**3 + 1):
    for b in range(-10**3, 10**3 + 1):
        if L[a + 10**4] - L[b + 10**4] == X:
            print(a, b)
            import sys
            sys.exit()