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
def input(): return sys.stdin.readline().rstrip()
def main():
    x=int(input())
    for i in range(-300,300):
        for j in range(-300,300):
            if i**5-j**5==x:
                print(i,j)
                sys.exit()

if __name__=='__main__':
    main()

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

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

b=0
while(True):
    bi=b**5
    ai=x+bi

    
    if(int((ai**(1/5))%1.0) == 0):

        aj=int((ai**(1/5))//1)

        if((aj**5)==ai):
            print(aj,b)
            break
    b*=-1

    bi=b**5
    ai=x+bi

    if(ai>=0 and int((ai**(1/5))%1.0) == 0):
        aj=int((ai**(1/5))//1)

        if((aj**5)==ai):
            print(aj,b)
            break
    b*=-1

    b+=1

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

def calc(X):
    for a in range(1000):
        for b in range(-1000,a):
            if a**5 - b**5 == X:
                return (a,b)



a,b=calc(X)
print(f"{a} {b}")

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

Solution (Python):
X=int(input())
x=0
list=[]
for i in range(-118,120,1):
    for j in range(-119,119,1):
        x=i**5-j**5
        if x==X:
            print((str(i)+' '+str(j)))
            break
    else:
        continue
    break

Solution (Python):
X=int(input())
x=0
list=[]
for i in range(-118,120,1):

    for j in range(-119,119,1):
        x=i**5-j**5
        if x==X:
            list.append((str(i)+' '+str(j)))

print(list[0])

Solution (Python):
x = int(input())
flg = False
for i in range(1, int(x**0.5)+1):
  if flg:
    break
  if x % i == 0:
    a = 0
    b = - i
    while True:
      cnt = a**5 - b**5
      if cnt == x:
        flg = True
        print(a, b)
        break
      else:
        if a > 0 and b > 0:
          if cnt > x:
            break
        a += 1
        b += 1

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

a=0
b=0

while True:
    hantei_p=(X+b**5)**0.2
    hantei_n=(X-b**5)**0.2

    if abs(int(hantei_p)-hantei_p)<1:
       a=int(hantei_p)
       if a**5-b**5==X:
           print("{} {}".format(a,b))
           break
    if isinstance(hantei_n**0.2,float):
        if abs(int(hantei_n)-hantei_n)<1:
            a=int(hantei_n)
            if a**5+b**5==X:
                print("{} {}".format(a,-b))
                break
    
    b +=1

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

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

Solution (Python):
import sys


x = int(input())

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

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

L=[0]*122
for i in range(1,121):
    ii=i**2
    iii=ii**2
    L[i]=i*iii

ans="ERROR"

for j in range(122):
    a=L[j]
    if x-a in L:
        ans=[int(a**0.2),int(-((x-a)**0.2))]
    elif a-x in L:
        ans=[int(a**0.2),int((a-x)**0.2)]
    else:
        pass

print(*ans)

Solution (Python):
import math
import sys



x = int(input())

maxn = 128
for a in range(maxn):
    for b in range(a+1,maxn):
        if b**5 - a**5 == x:
            print(b,a)
            sys.exit()
        elif a**5 + b**5 == x:
            print(a,-1*b)
            sys.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)
            exit()

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

for i in range(1000):
    for j in range(1000):
        if f[i] - f[j] == x:
            print(i,j)
            exit()
        if f[i] + f[j] == x:
            print(i,-j)
            exit()

Solution (Python):

x = int(input())
for i in range(-120,120):
    for j in range(-120,120):
        if i**5-j**5==x:
            a = i
            b = j
            break
        
print(a,b)

Solution (Python):
x =int(input())
a =[i**5 for i in range(120)]
for i in range(120):
    for j in range(i+1,120):
        if a[j] -a[i] ==x:
            print(j,i)
            break
        if a[j] +a[i] ==x:
            print(j,-i)
            break

Solution (Python):
x=int(input())
def f(a,p):
    return 5*a**4+10*(a**3)*p+10*(a**2)*(p**2)+5*a*(p**3)+p**4
for i in range(1,x+1):
    if i*i>x:
        break
    if x%i==0:
        p=i;q=x//i
        if p**4%5==q%5:
            for b in range(-1000,1000):
                if f(b,p)==q:
                    print(b+p,b)
                    exit(0)
        p=-1*i;q=(-1)*(x//i)

        for b in range(-1000,1000):
            if f(b,p)==q:
                print(b,b+p)
                exit(0)

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

flag = False
for a in range(-1000, 1000):
    for b in range(-1000, 1000):
        if (a**5 - b**5) == x:
            print(a, b)
            flag = True
            break
    if flag:
        break

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

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

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

judge = False
for a in range(1001):
    for b in range(-200, 200):
        s = a**5 - b**5
        if s == x:
            judge = True
            break
    if judge:
        break

print(a, b)

Solution (Python):
x = int(input())
def make_divisors(n):
    divisors = [0]
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
    return divisors

flag = 0
a_s = 0
if x == 1:
  print(1, 0)
else:
  l = make_divisors(x)
  for a in range(a_s, x+1):
    if flag == 1:
      break
    for b_a in l:
      if b_a <= a:
        b = a - b_a
        if a**5 - b**5 == x or a**5 + b**5 == x:
          flag += 1
          print(a, b)
          break
      if b_a > a:
        b = b_a - a
        if a**5 + b**5 == x:
          flag += 1
          print(a, -b)
          break

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

Solution (Python):


from math import sqrt
from itertools import product

def prime(n):
    assert(n > 1)
    n = int(n)
    sq_n = int(sqrt(n)) + 1
    hurui = [False] * sq_n
    ret = []
    for i in range(2, sq_n):
        cnt = 0
        if hurui[i]:
            continue
        for ii in range(i, sq_n, i):
            hurui[ii] = True
        while n % i == 0:
            n = n // i
            cnt += 1
        if cnt > 0:
            ret.append((i, cnt))
    if n != 1:
        ret.append((n, 1))
    return ret

def pairs(N):
    N = int(N)
    nlist = prime(N)
    n, cnt = zip(*nlist)
    ret = []
    for _cnt in product(*(list(range(c + 1)) for c in cnt)):
        val = 1
        for _n, _c in zip(n, _cnt):
            val *= _n ** _c
        ret.append([val, N // val])
    ret.sort()
    return ret


X = int(input())

if X == 1:
    print(0, -1)
    exit(0)

for n, m in pairs(X):
    
    if (n**4 - m**4) % 5 != 0:
        continue
    for B in range(-n // 2 - 1, int(m ** 0.25)):
        A = B + n
        if A ** 5 - B ** 5 == X:
            break
    if A ** 5 - B ** 5 == X:
        break
print(A, B)

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

Solution (Python):
n = int(input())
 
a = [i**5 for i in range(120)]
for i in range(120):
    for j in range(i+1,120):
        if a[j]-a[i] == n:
            print(j,i)
            break
        if a[j]+a[i] == n:
            print(j,-i)
            break
    else: continue
    break

Solution (Python):
def main():
    import math
    x=int(input())
    stop=False
    
    for a in range(int(math.pow(10**9,1/5))+1):
        for b in range(int(math.pow(10**9,1/5))+1):
            if a**5-(-b)**5==x:
                print(a,-b)
                stop=True
                break
        if stop:
            break
    else:
        
        a_range_num=int(math.pow(10**9+(math.pow(2,1/4)*10**2)**5,1/5))
        for b in range(int(math.pow(10**9,1/4))+1):
            for a in range(b,a_range_num+1):
                if a**5-b**5==x:
                    print(a,b)
                    stop=True
                    break
            if stop:
                break
if __name__=="__main__":
    main()

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

stop=False

for a in range(int(math.pow(10**9,1/5))+1):
    for b in range(int(math.pow(10**9,1/5))+1):
        if a**5-(-b)**5==x:
            print(a,-b)
            stop=True
            break
    if stop:
        break
else:
    
    a_range_num=int(math.pow(10**9+(math.pow(2,1/4)*10**2)**5,1/5))
    for b in range(int(math.pow(10**9,1/4))+1):
        for a in range(b,a_range_num+1):
            if a**5-b**5==x:
                print(a,b)
                stop=True
                break
        if stop:
            break

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

stop=False
for i in range(int(math.pow(10**9,1/5))+1):
    for j in range(int(math.pow(10**9,1/5))+1):
        if i**5-(-j)**5==x:
            print(i,-j)
            stop=True
            break
    if stop:
        break
else:
    stop=False
    range_num=int(math.pow(10**9+(math.pow(2,1/4)*10**2)**5,1/5))
    for i in range(int(math.pow(10**9,1/4))+1):
        for j in range(i,range_num+1):
            if j**5-i**5==x:
                print(j,i)
                stop=True
                break
        if stop:
            break

Solution (Python):
x=int(input())
a,b=-1,-1
for i in range(-130,131):
    for j in range(-130,131):
        if pow(i,5)-pow(j,5)==x:
            a=i
            b=j
            break
print(a,b)

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

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

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

A = 0
while True:
    for B in range(A+1):
        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()
    A += 1

Solution (Python):
memorization_dict = dict()
max_number = 10 ** 13
i = 0
power_value = 0
while power_value <= max_number:
    power_value = i ** 5
    memorization_dict[power_value] = i
    i += 1

X = int(input())

solution_1 = 0
solution_2 = 0

for B in memorization_dict.keys():
    A = X + B
    if A in memorization_dict.keys():
        solution_1 = memorization_dict[A]
        solution_2 = memorization_dict[B]
        break
    A = X - B
    if A in memorization_dict.keys():
        solution_1 = memorization_dict[A]
        solution_2 = memorization_dict[B] * (-1)
        break

print(solution_1, solution_2)

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

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

Solution (Python):
N = int(input())
MAX = 128

for i in range(-MAX, MAX+1):
    for j in range(-MAX, MAX+1):
        if i**5 - j**5 == N:
            print(i, j)
            exit()

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




flag = False
for a in range(10001):
    for b in range(-1000, 1000):
        s = a**5 - b**5
        if s == x:
            flag = True
            break
    if flag:
        break

print(a, b)

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

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

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

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

Solution (Python):


import sys
import itertools


def solve(X: int):
    for a in range(-118, 119):
        for b in range(-119, 118):
            if a**5-b**5 == X:
                print(f'{a} {b}')
                return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  
    solve(X)


if __name__ == '__main__':
    main()

Solution (Python):
def get_answer():
  x = int(input())
  
  is_get = False
  for a in range(1000000000):
    if is_get:
      break
    for b in range(-1*a, a, 1):
      if x == a**5 - b**5:
        is_get = True
        break
        
  print(f"{a-1} {b}")

if __name__ == "__main__":
  get_answer()

Solution (Python):

x=int(input())
lists=[(i**5,i) for i in range(-1000,1000)]
N=len(lists)
def solve(x):
    for i in range(N):
        for j in range(i):
            if lists[i][0]-lists[j][0]==x:
                print(lists[i][1],lists[j][1])
                return True
solve(x)

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

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

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

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

Solution (Python):


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

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

Solution (Python):
import math
x = int(input())
cand = {i: i ** 5 for i in range(-100000, 100000)}
r_cand = {j: i for i, j in cand.items()}
set_a = set(cand)
if r_cand.get(x, 0):
    print(f"{r_cand[x]} 0")
else:
    result = [(r_cand[x + b], r_cand[b]) for b in r_cand if r_cand.get(x + b, 0)][0]
    print(f"{result[0]} {result[1]}")

Solution (Python):
"""
n = 1
while n**5 < 10**9:
  n += 1
print(n)

"""
X = int(input())

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

Solution (Python):
import itertools
"""
n = 1
while n**5 < 10**9:
  n += 1
print(n)

"""
X = int(input())

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

Solution (Python):
from math import sqrt

x = int(input())

root = int(sqrt(sqrt(x)))

check = 0
for a in range(-1 * root, root * 2):
    for b in range(-1 * root, root * 2):
        if a * a * a * a * a - b * b * b * b * b == x:
            print(f"{a} {b}")
            check = 1
        if check == 1:
            break
    if check == 1:
        break

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

flag = False
for a in range(-118,120):
    for b in range(-119,119):
        if a**5-b**5==X:
            print(a,b)
            flag = True
            break
    if flag:
        break

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


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

x = int(input())

fact_x = smallDivisors(x)

for f in fact_x:
    fact_const = divisors(abs((f ** 4) - (x // f)))
    fact_const.append(0)
    for a in fact_const:
        b = a - f
        if (a**4 + (a**3) * b + (a**2) * (b**2) + a * (b**3) + b**4) == x // f:
            print("{} {}".format(a, b))
            break
    else:
        continue
    break

Solution (Python):
X=int(input())
stp=0
for a in range(120):
    if stp==1:
        break
    else:
        for b in range(120):
            A=a**5
            B=b**5
            tmp1=A-B
            tmp2=-A+B
            tmp3=-A-B
            tmp4=A+B
            if tmp1==X:
                print(a,b)
                stp=1
                break
            elif tmp2==X:
                print(-a,-b)
                stp=1
                break
            elif tmp3==X:
                print(-a,b)
                stp=1
                break
            elif tmp4==X:
                print(a,-b)
                stp=1
                break

Solution (Python):
x=int(input())
def sol():
  for a in range(-119,121):
    for b in range(-119,121):
      if x == a**5-b**5:
        print(a,b)
        return

sol()

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

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







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

Solution (Python):
import sys

x = int(input())

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

Solution (Python):
import numpy as np
x=int(input())

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

Solution (Python):

X = int(input())
X_0 = int(X**0.5)
X_list = []
for i in range(1, X_0 + 1):
    if X%i == 0:
        X_list.append(i)

flag = False
ans = 0
for x in X_list:
    y = X/x
    y1 = y**0.5
    y2 = int(y**0.5)
    for A in range(x, y2+1):
        if A**5 - (A-x)**5 == X:
            flag = True
            ans = (A, A-x)
            break
if flag:
    print(ans[0], ans[1])
else:
    for x in X_list:
        for B in range(1, x+1):
            if (x-B)**5 + B**5 == X:
                flag = True
                ans = (x-B, -B)
    if flag:
        print(ans[0], ans[1])

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

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

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

def solve():
    for a in range(1000):
        for b in range(-1000,1000):
            if a**5 - b**5 == X:
                return a,b

a,b = solve()
print(a,b)

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

for i in range(len(make_divisors(X))):
    A = make_divisors(X)[i]
    for j in range(-64,119):
        if (A+j)**5-j**5==X:
            a = j + A
            b = j
            break
        else:
            continue
        break
    else:
        continue
    break
print(a,b)

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

Solution (Python):
X = int(input())
INF = 1000
A = [i ** 5 for i in range(INF)]
B = [i ** 5 for i in range(INF)]

def solve():

    for i in range(INF):
        for j in range(INF):
            if X == A[i] - B[j]:
                print(i, j)
                return

    for i in range(INF):
        for j in range(INF):
            if X == A[i] + B[j]:
                print(i, -j)
                return

    for i in range(INF):
        for j in range(INF):
            if X == -A[i] - B[j]:
                print(-i, j)
                return

    for i in range(INF):
        for j in range(INF):
            if X == -A[i] + B[j]:
                print(-i, -j)
                return
            
solve()

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

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

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

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

Solution (Python):
import math

x = int(input())


def check(x):
    i = 1
    while True:
        for j in range(i):
            if (i == j):
                continue
            elif (x % (i - j) == 0) and (x == ((i ** 5) - (j ** 5))):
                print(i, j)
                return
            elif (x % (i + j) == 0) and ( x == ((i ** 5) + (j ** 5))):
                print(i, -j)
                return
        i = i + 1

check(x)

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

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

Solution (Python):
i=j=x=int(input())
while i**5-j**5-x:i=-~i%127;j=j%257-i
print(i,j)

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

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


if __name__ == "__main__":
    main()

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

Solution (Python):
i=j=x=int(input())
while i**5-j**5-x:i=-~i%120;j=j%221-99
print(i,j)

Solution (Python):
i=j=x=int(input())
while i**5-j**5-x:i=-~i%120;j=-~j%217-98
print(i,j)

Solution (Python):
i=j=x=int(input())
while i**5-j**5-x:i=-~i%120;j=(j+99)%217-98
print(i,j)

Solution (Python):
x=int(input())
i=j=c=5**6
while i**5-j**5-x:c-=1;i=c%128;j=c>>7
print(i,j)

Solution (Python):
if __name__ == '__main__':
    x = int(input())
    a = -1
    b = -1
    for i in range(0,1001,1):
        got = False
        for j in range(0,1001,1):
            
            if (i**5 - j**5) == x:
                a = i
                b = j
                got = True
                break
            if (i**5 + j**5) == x:
                a = i
                b = -1*j
                got = True
                break
        if got:
            break
    print(*[a,b])

Solution (Python):
x=int(input())
i=j=0
while i**5-j**5-x:i=-~i%120;j=(j+99)%217-98
print(i,j)

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

ans=[0,0]
i=0
while i<=1000:
    j=-1000
    while j<=1000:
        if i**5-j**5==X:
            ans=[i,j]
        j+=1
    i+=1 

print(*ans)

Solution (Python):

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

Solution (Python):
X = int(input())
for i in range(238):
  for k in range(238):
    A = i - 118
    B = k - 118
    if A**5 - B**5 == X:
      print(A,B)
      break
  else:
    continue
  break

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

x = int(input())
eps = 1e-9
a = 1
while True:
    diff = a**5-x
    if diff < 0:
        diff = abs(diff)
        sign = True
    else:
        sign = False
    if abs(diff**0.2 - round(diff**0.2)) < eps:
        b = round(diff**0.2)
        if sign:
            b = -b
        break
    a += 1
print a,int(b)

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

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

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

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

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

pow5 = [i**5 for i in range(-120,120)]

for a in range(-120,120):
    for b in range(-120,120):
        if pow5[a+120] - pow5[b+120] == x:
            print(a , b)
            exit(0)

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

A = 200

f = True
while f:
    for B in range(-200,200,1):
        if A**5 - B**5 == x:
            print(A, B)
            f = False
    A -= 1

Solution (Python):
def calcurate(x):
  for a in range(1000):
    a5 = a**5
    for b in range(-1000, 1000):
      b5 = b**5
      if a5 - b5 == X:
        return a, b
      
if __name__ == "__main__":
  X = int(input())
  A, B = calcurate(X)
  print(A, B)

Solution (Python):
x = int(input())
flg = False
for a in range(150):
  for b in range(-150, a):
    if a**5 - b**5 == x:
      print("{} {}".format(a, b))
      flg = True
      break
  if flg: break

Solution (Python):
x = int(input())
LIMIT = 10 ** 9
lmt = 0

while lmt ** 5 - (lmt - 1) ** 5 <= LIMIT:
    lmt += 1


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

Solution (Python):
X = int(input())
pow5 = [i**5 for i in range(-150,150)]
for a in range(-150,150):
  for b in range(-150,150):
    if pow5[a+150]-pow5[b+150] ==X:
      print(a,b)
      exit(0)

Solution (Python):
X = int(input())
pow5 = [i**5 for i in range(-150,150)]
for a in range(-150,150):
  for b in range(-150,150):
    if pow5[a+150]-pow5[b+150] ==X:
      print(a,b)
      exit(0)

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

pow5 = [(i, i ** 5) for i in range(-1000, 1000)]

for a, a5 in pow5:
  for b, b5 in pow5:
    if a5 - b5 == x:
      print(f"{a} {b}")
      exit(0)

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

pow5 = [i ** 5 for i in range(-1000, 1000)]

for a in range(-1000, 1000):
  for b in range(-1000, 1000):
    if pow5[a + 1000] - pow5[b + 1000] == x:
      print(f"{a} {b}")
      exit(0)

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

pow5 = [i ** 5 for i in range(-1000, 1000)]

for a in range(-1000, 1000):
  for b in range(-1000, 1000):
    if pow5[a + 1000] - pow5[b + 1000] == x:
      print(f"{a} {b}")
      exit(0)

Solution (Python):
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=" ")
            break
        if a**5 + b**5 == x:
            print(a, -b, sep=" ")
            break

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

def f(a, b):
    return a ** 5 - b ** 5
def make_divisors(n):
    divisors = []
    for i in range(1, int(math.sqrt(n)) + 1):
        if n % i == 0:
            divisors.append(i)
            
            if i != n // i:
                divisors.append(n // i)
    return divisors
division = sorted(make_divisors(x))
sele = math.floor(x ** (1/4))
for div in division:
    for j in range(-sele, sele + 1):
        a1 = j
        b1 = j - div
        if f(a1, b1) == x:
            print(a1, b1)
            break
    else:
        continue
    break

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

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

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

f()

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

Solution (Python):
from itertools import count

def main():
    X = int(input())
    for i in count():
        for A in (-i, i):
            for B in range(-i, i+1):
                if A**5 - B**5 == X:
                    print(A, B)
                    return


main()

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

Solution (Python):
x = int(input())
for a in range(-118, 119 + 1):
    for b in range(-119, 118 + 1):
        if a ** 5 - b ** 5 == x:
            print(a, b)
            break
    else:
        continue
    break

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

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

Solution (Python):
import sys
X = int(input())
a = 1
b = 0
for a in range(1, 120):
  for b in range(-119, a):
    if pow(a, 5) - pow(b, 5) == X:
      print(a,b)
      sys.exit()

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


def fif_root(arg):
    def root(x):
        return math.floor(math.pow(x,1/5)*pow(10,10))/pow(10,10)
    return list(map(lambda x: root(x), arg))

def check_integer(arg):
    return list(map(lambda x: x.is_integer(), arg))

a = 0
while (A:= math.pow(a, 5))-math.pow(a-1, 5) <= X:
    
    root = fif_root([abs(X-A), X+A])
    if True in (c := check_integer(root)):
        idx = c.index(True)
        b = int(root[idx])
        if idx == 1:
            a, b = -a, -b
        else:
            if X - A >= 0:
                b = -b
        print(a, b)
        break
    a += 1

Solution (Python):
import bisect
x = int(input())
aa = [a**5 for a in range(-1000, 1001)]
aset = set(aa)
for a in aa:
    if x+a in aset:
        ans = (x+a, a)
        break
ans1, ans2 = float('inf'), float('inf')
for i in range(-1000, 1001):
    if i**5==ans[0]: ans1 = i
    if i**5==ans[1]: ans2 = i
    if ans1==float('inf') or ans2==float('inf'): continue
    break
print(ans1, ans2, sep=' ')

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

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

Solution (Python):
x = int(input())
for a in range(-200,201):
    for b in range(-200,201):
        if a**5 - b**5 == x:
            print("{} {}".format(a,b))
            exit()

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

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

Solution (Python):
import sys

X = int(input())
a = 1
b = 0
for a  in range(1,120):
  for b in range(-119, a):
    if pow(a,5)- pow(b,5) == X:
      print(a,b)
      sys.exit()

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