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

li = [i ** 5 for i in range(1005)]

for a in range(1000):
    for b in range(1000):
        t1 = li[a] - li[b]
        t2 = li[a] + li[b] if b % 2 == 1 else t1
        if t1 == X:
            print(a, b)
            exit()
        elif  t2 == X:
            print(a, -b)
            exit()

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

Solution (Python):
import sys
from collections import deque, defaultdict, Counter
from itertools import accumulate, product, permutations, combinations
from operator import itemgetter
from bisect import bisect_left, bisect_right
from heapq import heappop, heappush
from math import ceil, floor, sqrt, gcd, inf
from copy import deepcopy
import numpy as np
import scipy as sp

INF = inf
MOD = 1000000007

x = int(input())

tmp = [i ** 5 for i in range(ceil(x ** 0.25) + 1)]
res = 0

for a in range(len(tmp) - 1):
    for b in range(a + 1, len(tmp)):
        if tmp[a] - tmp[b] == x:
            res = f"{a} {b}"
            break
        elif tmp[a] + tmp[b] == x:
            res = f"{a} {-b}"
            break
        elif -tmp[a] + tmp[b] == x:
            res = f"{-a} {-b}"
            break
        elif -tmp[a] - tmp[b] == x:
            res = f"{-a} {b}"
            break

print(res)

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

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

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

for a in range(-118,120):
    for b in range(-119,119):
        if a ** 5 - b **5 == n :
            print(a,b)
            exit()

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

while True:
  for a in range(-200, 201):
    for b in range(-200, 201):
      if a**5 - b**5 ==X:
        exit(print(a,b))

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

Solution (Python):



import sys

X = int(input())

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

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

s = []
for i in range(300):
    j = i ** 5
    s.append(j)
    s.append(-1*j)

for a in s:
    for b in s:
        ans = a - b
        if ans == x:
            if a >= 0:
                aa = int(a ** (1/5))
            else:
                aa = int(abs(a) ** (1/5)) * -1
            if b >= 0:
                bb = int(b ** (1/5))
            else:
                bb = int(abs(b) ** (1/5)) * -1
            print(aa,bb)
            exit()

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

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

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

    for i in range(-120, 120):
        for j in range(-120, 120):
            if i ** 5 - j ** 5 == X:
                print(i, j)
                return

if __name__ == '__main__':
    main()

Solution (Python):
x=int(input())
for i in range(-118,120):
  for j in range(-119,1119):
    if i**5-j**5==x:
      print(i,j)
      exit()

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




for a in range(-118, 119 + 1):
    tgt = a ** 5 - X
    for b in range(-119, 119):
        if tgt == b ** 5:
            print(a, b)
            exit()

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

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

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)
            break
    else:
        continue
    break

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

for a in range(10**4):
  for b in range(10**4):
    if a**5-b**5==X:print(a,b);exit()
    elif a**5+b**5==X:print(a,-b);exit()

Solution (Python):
X=int(input())
flagp=False
flagm=False
flage=True
for A in range(-10**3,10**3):
    B5=A**5-X
    for B in range(10**3):
        if B5==B**5:
            flagp=True
            flage=False
            break
        elif B5==-B**5:
            flagm=True
            flage=False
            break
    else:
        continue
    break
if flagp:
    print(A,B)
elif flage:
    raise Exception
else:
    print(A,-B)

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

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

Solution (Python):
x=int(input())
for a in range(-200,201):
	f=False
	for b in range(-201,201):
		if a**5-b**5==x:
			print(a,b)
			f=True
			break
	if f:break

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











def inp():
    return int(input())
def inps():
    return input().rstrip()
def inpl():
    return list(map(int, input().split()))
def _debug(obj):
    print(obj, file=sys.stderr)



X = inp()

for i in range(-120, 120):
    for j in range(-120, 120):
        if i**5 - j**5 == X:
            print(i, j)
            sys.exit()

Solution (Python):
def main():
    X = int(input())
    a_max = None
    a = 1
    while True:
        if a**5 - (a-1)**5 > X:
            a_max = a - 1
            break
        else:
            a += 1
    a_min = None
    a = -1
    while True:
        if a**5 - (a-1)**5 > X:
            a_min = a + 1
            break
        else:
            a -= 1

    for a in range(a_min, a_max+1):
        for b in range(a_min-1, a_max):
            if a**5 - b**5 == X:
                print(a, b)
                exit()


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())
for i in range(10**4):
    for j in range(10**4):
        x = i - 10**4//2
        y = j - 10**4//2
        if x**5 - y**5 == X:
            s = str(x) + " " + str(y)
            print(s)
            break
    else:
        continue
    break

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

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

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

Solution (Python):
def main():
    x = int(input())
    a_lst = []
    b_lst = []
    for i in range(400):
        a_lst.append(-200 + i)
    for i in range(400):
        b_lst.append(-200 + i)

    flag = False
    for i in range(len(a_lst)):
        for j in range(len(b_lst)):

            a = a_lst[i]
            b = b_lst[j]
            if a ** 5 - b ** 5 == x:
                print(a, b)
                flag = True
                break

        if flag:
            break


if __name__ == '__main__':
    main()

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

Solution (Python):
import math, sys

X = int(input())

if int(X**(1/5)) **5 ==X:
    print(*[ int(X**(1/5)) , 0])
    sys.exit()

for i in range(1,10**7):
    A = i**5
    B = A - X
    C = X - A

    if B > 0 and int(B**(1/5)) **5 == B:
        print(*[ i , int(B**(1/5)) ])
        sys.exit()

    if C > 0 and int(C**(1/5)) **5 ==C:
        print(*[ i , - int(C**(1/5)) ])
        sys.exit()

Solution (Python):
from sys import exit
import math
import collections
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

x = ii()

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

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

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


for a in range(-118,120):
    for b in range(-119,119):
        if a**5 - b**5 == X:
            ans = (a,b)
            break

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

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

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

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

Solution (Python):
import sys

input=sys.stdin.buffer.readline





def RD(): return sys.stdin.read()


def II(): return int(input())


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


def MF(): return map(float,input().split())


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


def LF(): return list(map(float,input().split()))


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



import numpy as np

def main():
	x=II()
	for i in range(-300,300):
		for j in range(-300,300):
			if i**5==x+j**5:
				print(i,j)
				exit()






if __name__=="__main__":
	main()

Solution (Python):
import sys

from collections import deque, Counter, defaultdict

import bisect
import heapq

import itertools
import numpy as np
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
inf = 10**18
MOD = 1000000007
ri = lambda : int(input())
rs = lambda : input().strip()
rl = lambda : list(map(int, input().split()))
x = ri()
for i in range(-200, 200):
    for j in range(-200, 200):
        if i**5 - j**5 == x:
            print(i,j)
            sys.exit()

Solution (Python):
x=int(input())
a=0
while True:
    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()
        elif -a**5+b**5==x:
            print(-a,-b)
            exit()
    a+=1

Solution (Python):
x=int(input())
a=0
while True:
    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()
        elif -a**5+b**5==x:
            print(-a,-b)
            exit()
    a+=1

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

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

Solution (Python):
import math
X = int(input())
A, B = 1, 1


def is_ok(i, x):
    return pow(i, 5) >= x


def bisect(ng, ok, x):
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if is_ok(mid, x):
            ok = mid
        else:
            ng = mid
    return ok


ss = math.ceil(X ** (1 / 4)) + 10
for a in range(1, math.ceil(X ** (1 / 4)) + 10):
    tmp = abs(pow(a, 5) - X)
    b = bisect(-1, ss, tmp)
    if tmp == pow(b, 5):
        A = a
        if a ** 5 - X > 0:
            B = b
        else:
            B = -1 * b
        break
print(A, B)

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

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

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

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

    return sorted(return_list)

X = int(input())
list = make_divisors(X)
mlist = []
for li in list[::-1]:
    mlist.append(-li)
mlist += list
B = -120
while True:
    for i in mlist:
        if ((B + i) ** 5) - (B ** 5) == X:
            print(B+i,B)
            exit()
    B += 1

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

for i in range(120):
    for j in range(120):
        y = i**5 + j**5
        z = i**5 - j**5
        if z == x:
            a = i
            b = j
            print("{} {}".format(a, b))
            exit()
        if y == x:
            a = i
            b = -j
            print("{} {}".format(a, b))
            exit()

Solution (Python):

def main():
    x = int(input())
    for i in range(1,1000):
        for j in range(-1000,1000):
            if i**5-j**5 ==x:
                print(f"{i} {j}")
                return

if __name__ == "__main__":
    main()

Solution (Python):
X = int(input())
i = 0
f = True
while f:
    for j in range(-i,i+1):
        if i**5 - j**5 == X:
            f = False
            break
    else:
        i += 1
print(i,j)

Solution (Python):
X = int(input())
i = 0
f = True
while f:
    for j in range(-i,i+1):
        if i**5 - j**5 == X:
            f = False
            break
    else:
        i += 1
print(i,j)

Solution (Python):
x = int(input())
flg = 0
for i in range(-118,120,1):
    for j in range(-119,119,1):
        if (i)**5 - (j)**5 == x:
            ans1 = i
            ans2 = j
        
print(str(ans1)+str(" ")+str(ans2))

Solution (Python):
import sys
import heapq
from decimal import Decimal

input = sys.stdin.readline

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

Solution (Python):
import sys
import heapq
from decimal import Decimal

input = sys.stdin.readline

x = int(input())


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

Solution (Python):
x = int(input())
for i in range(400):
  for j in range(400):
    ii = i - 200
    jj = j - 200
    if ii**5 - jj**5 == x:
      print(ii,jj)
      exit()
assert false, "final"

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

Solution (Python):
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
import numpy as np
def main():
    x = int(input())
    n5 = np.array([i**5 for i in range(-201, 201)])
    diff = np.subtract.outer(n5, n5)
    r = np.where(diff == x)
    
    print(r[0][0]-201, r[1][0]-201)

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

Solution (Python):
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines

from itertools import product
def main():
    x = int(input())
    n5 = [i**5 for i in range(201)]

    c = product(n5, repeat=2)
    for ce in c:
        if ce[0] + ce[1] == x:
            r = (int(ce[0]**0.2), int(ce[1]**0.2)* -1)
            break
        elif ce[0] - ce[1] == x:
            r = (int(ce[0] ** 0.2), int(ce[1] ** 0.2))
            break
    print(*r, sep=' ')

if __name__ == '__main__':
    main()

Solution (Python):
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
import numpy as np
from itertools import product
def main():
    x = int(input())
    n5 = [i**5 for i in range(201)]

    c = product(n5, repeat=2)
    for ce in c:
        if ce[0] + ce[1] == x:
            r = (int(ce[0]**0.2), int(ce[1]**0.2)* -1)
            break
        elif ce[0] - ce[1] == x:
            r = (int(ce[0] ** 0.2), int(ce[1] ** 0.2))
            break
    print(*r, sep=' ')

if __name__ == '__main__':
    main()

Solution (Python):
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
import numpy as np
def main():
    x = int(input())
    for i1 in range(-201, 201):
        for i2 in range(-201, 201):
            if i1**5 - i2**5 == x:
                print(i1, i2)
                sys.exit()

if __name__ == '__main__':
    main()

Solution (Python):
X=int(input())
def check():
    for a in range(-200,200):
        for b in range(-200,200):
            if a**5-b**5==X:
                print(a,b)
                return 0
check()

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

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


if __name__ == "__main__":
    main()

Solution (Python):
def solve():
    x = int(input())
    for i in range(-150, 151):
        for j in range(-150,i):
            if i ** 5 - j ** 5 == x:
                print(i,j)
                return

if __name__ == '__main__':
    solve()

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

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

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

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

quint = [0] * 1001

for i in range(1, 1001):
  quint[i] = i ** 5
  
for i in range(0, 1001):
  a = X - quint[i] 
  b = X + quint[i]
  try:
    c = quint.index(a)
    print("{} {}".format(c, -i))
    break
  except:
    try:
      c = quint.index(b)
      print("{} {}".format(c, i))
      break
    except:
      continue

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

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

a = 0
b = 0

while True:
    cand = a**5-b**5
    if cand == X:
        print(str(a) + " " + str(b))
        exit()
    elif cand < X:
        a += 1
    else:
        b += 1

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

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

Solution (Python):
def main():
    x = int(input())
    for i in range(-118, 120):
        for j in range(-119, 119):
            if i**5 - j**5 == x:
                print(i, j)
                exit()

if __name__ == '__main__':
    main()

Solution (Python):
import numpy as np
X = int(input())
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]
div = make_divisors(X)
for i in range(len(div)):
    x = div[i]
    z = x**4 - X/x
    if z%5 == 0:
        s = z / 5
        if x**4 - 4*s >=0:
            y1 =( -x**2 + np.sqrt(x**4 - 4 * s)) / 2
            y2 =( -x**2 - np.sqrt(x**4 - 4 * s)) / 2 
            B1 = (-x + np.sqrt(x**2 + 4*y1))/2
            if B1.is_integer():
                B = B1
                A = B + x
                break
            B12 = (-x + np.sqrt(x**2 + 4*y2))/2
            if B12.is_integer():
                B = B12
                A = B + x
                break
            B2 = (-x - np.sqrt(x**2 + 4*y1))/2
            if B2.is_integer():
                B = B2
                A = B + x
                break
            B21 = (-x - np.sqrt(x**2 + 4*y2))/2
            if B21.is_integer():
                B = B21
                A = B + x
                break
print(int(A),int(B))

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

for a in range(-200,200):
    for b in range(-200,200):
        
        if a**5 - b**5 == x:
            print(a,b)
            break
        
    else:
        continue
    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('%d %d' % (A, B))
            exit(0)

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

a = 0
b = 0
flg = True

while True:
  a += 1
  for i in range(a):
    if a**5 - i**5 == x:
      a = a
      b = i
      flg = False
      break
    elif a**5 + i**5 == x:
      a = a
      b = -i
      flg = False
      break
  if flg == False:
    break
  
a = str(a)
b = str(b)
print(a+' '+b)

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

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

p = make_divisors(x)

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

Solution (Python):
def main():
	X = int(input())
	fifth_power = [x ** 5 for x in range(201)]
	for i in range(len(fifth_power)):
		p = fifth_power[i]
		q1 = abs(X - p)
		q2 = abs(X + p)
		if q1 in fifth_power:
			if p + q1 == X:
				print(fifth_power.index(p), -fifth_power.index(q1))
			elif p - q1 == X:
				print(fifth_power.index(p), fifth_power.index(q1))
			return 0
		if q2 in fifth_power:
			print(fifth_power.index(q2), fifth_power.index(p))
			return 0

main()

Solution (Python):
import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def main():
    x = I()

    for a in range(-118,119+1):
        for b in range(-119,118+1):
            if a**5-b**5==x:
                break
        if a**5-b**5==x:
            break
    print(a,b)
main()

Solution (Python):
def getval():
    return int(input())

def main(x):
    for i in range(-200,201):
        flag = False
        for j in range(-200,201):
            if i**5-j**5==x:
                print("{a} {b}".format(a=str(i),b=str(j)))
                flag = True
                break
        if flag:
            break
                
                

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

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

N = 200

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

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

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

for i in range(len(l)-1):
    for j in range(i+1,len(l)):
        if l[j]-l[i]==x:
            print(int(l[j]**(1/5)),int(l[i]**(1/5)))
            exit()
        if l[j]+l[i]==x:
            print(int(l[j]**(1/5)),-int(l[i]**(1/5)))
            exit()
print('Not found')

Solution (Python):
a=int(input())
b=0
c=int(a**(1/2))
for i in range(-1000,1000):
    for j in range(-1000,1000):
        if((i**5)-(j**5)==a):
            b=1
            break
    if(b==1):
        break
print(i,j)

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

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

Solution (Python):

import sys
from itertools import chain





import math


def get_factors(X):
    """Xの約数を求める"""
    factors = []
    for i in range(1, math.ceil(X ** 0.5) + 1):
        if X % i == 0:
            factors.append(i)
            factors.append(X // i)
    factors.append(X)
    return sorted(factors)


def solve(X: int):
    factors = get_factors(X)

    
    a_max = math.floor(X ** (1 / 5))
    
    for amb in factors:
        for a in range(1, a_max + 1):
            b = a - amb
            if a ** 5 - b ** 5 == X:
                return str(a) + ' ' + str(b)

    
    a_min = math.ceil(X ** (1 / 5))
    a_max = math.floor(X ** (1 / 4))
    
    for amb in factors:
        for a in range(a_min, a_max + 1):
            b = a - amb
            if a ** 5 - b ** 5 == X:
                return str(a) + ' ' + str(b)

    return (0, 0)


def main():
    tokens = chain(*(line.split() for line in sys.stdin))
    
    X = int(next(tokens))  
    answer = solve(X)
    print(answer)


if __name__ == "__main__":
    main()

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

for i in range(-118,120):
    for j in range(-118,120) :
        if i**5-j**5==x :
            print(i,j)
            exit()
        else :
            continue

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

check = False
for i in range(-118,120):
  for j in range(-118,120):
    if i ** 5 - j ** 5 == X:
      ans = [i,j]
      check = True
      break
  if check:
    break
    
print(*ans)

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

Solution (Python):
def divisor(n):
    result = []
    i = 1
    while True:
        if i * i > n:
            break
        if n % i == 0:
            result.append(i)
            if i != int(n / i):
                result.append(int(n / i))
        i += 1
    return result


def calc(a, b):
    return a * a * a * a * a - b * b * b * b * b


MX = 100000

INF = int(MX**6)


def main():
    X = int(input())
    drs = divisor(X)
    for dr in drs:
        right = MX - dr
        left = -MX
        while right - left > 8:
            bp = int(left + (right - left) / 3)
            bq = int(left + 2 * (right - left) / 3)
            cp = calc(bp + dr, bp)
            cq = calc(bq + dr, bq)
            if cp > cq:
                left = bp
            else:
                right = bq

        mn = INF
        mnb = -2 * MX
        for bi in range(left - 64, right + 64):
            c = calc(bi + dr, bi)
            if mn > c:
                mnb = bi
                mn = c

        left = mnb
        right = MX - dr
        while left <= right:
            b = int((left + right) / 2)
            c = calc(b + dr, b)
            if c == X:
                print(b + dr, b)
                return
            elif c < X:
                left = b + 1
            else:
                right = b - 1

        left = -MX
        right = mnb
        while left <= right:
            b = int((left + right) / 2)
            c = calc(b + dr, b)
            if c == X:
                print(b + dr, b)
                return
            elif c < X:
                left = b + 1
            else:
                right = b - 1


main()

Solution (Python):


import math

import itertools
from collections import deque
from collections import Counter
import heapq
from fractions  import gcd


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

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

Solution (Python):
import numpy as np

X = int(input())

x = np.arange(-300, 300, dtype=np.int64)

x5 = x**5
diff = np.subtract.outer(x5, x5)

i = np.where(diff == X)


x, y = i[0][0], i[0][1]
x -= 300
y -= 300

print(x, -y)

Solution (Python):
x=int(input())
l=[i**5 for i in range(-1000,1001)]
ok=False
for i in range(len(l)):
    if ok:
        break
    for j in range(len(l)):
        if l[i]-l[j]==x:
            print(i-1000,j-1000)
            ok=True
            break

Solution (Python):
X=int(input())
for i in range(-200,201):
    for j in range(-200,201):
        if (i**5)-(j**5)==X:
            print(i,j)
            exit()

Solution (Python):
def resolve():
    X = int(input())
    for a in range(-200, 201):
        for b in range(-200, 201):
            if a**5 - b**5 == X:
                print(a, b)
                return
    assert False


if '__main__' == __name__:
    resolve()

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

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

Solution (Python):
X = int(input())
A = 0
f = 1
while f:
  a = A ** 5
  B = 0
  while f:
    b = B ** 5
    if a <= X:
      if a + b == X:
        print(str(A)+" "+str(-B))
        f = 0
      elif a + b > X:
        break
    if a > X:
      if a - b == X:
        print(str(A)+" "+str(B))
        f = 0
      elif a - b < X:
        break
    B += 1
  A += 1

Solution (Python):
import math
import numpy as np
import sys
import os
from operator import mul

sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(_S())
def LS(): return list(_S().split())
def LI(): return list(map(int,LS()))

if os.getenv("LOCAL"):
    inputFile = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt'
    sys.stdin = open(inputFile, "r")
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7


X = I()

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

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)
            break
    else:
        continue
    break

Solution (Python):


import sys



X = int(input())

























for a in range(-130, 130):
    for b in range(-130, 130):
        _ = a ** 5 - b ** 5
        if _ == X:
            print(a, b)
            sys.exit()

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

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

ok = False
for a in range(200):
    for b in range(200):
        if a**5 - b**5 == X:
            ok = True
            A, B = a, b
            break
        
        if a**5 + b**5 == X:
            ok = True
            A, B = a, -b
            break
    
    if ok == True:
        break

print(A, end=' ')
print(B)

Solution (Python):
x = int(input())
a = 0
while True:
    for b in range(a):
        if abs(a ** 5 - b ** 5) == abs(x):
            if a ** 5 - b ** 5 == x:
                print(a, b)
                exit()
            else:
                print(-a, -b)
                exit()
        elif abs(a ** 5 + b ** 5) == abs(x):
            if a ** 5 + b ** 5 == x:
                print(a, -b)
                exit()
            else:
                print(-a, b)
                exit()
    a += 1

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