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):
from sys import stdin
import math
import fractions
from collections import deque
from collections import Counter
import itertools

INF = 10 ** 10

X = int(stdin.readline())




for i in range(-300, 300):
    for j in range(-300, 300):
        if (i**5) - (j**5) == X:
            print(i, j)
            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):
import sys

x = int(input())

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

Solution (Python):
import sys

sys.setrecursionlimit(10**7)

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  

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

Solution (Python):
Mod  = 10**9
i = 0
ans = 0
while ans<Mod:
    i+=1
    ans = i**5 - (i-1)**5


i = 0
ans = 0
while ans<Mod:
    i-=1
    ans = i**5-(i-1)**5



x = int(input())
Kouho = [int(i) for i in range(-120,121,1)]
for i in Kouho:
    for j in Kouho:
        if i**5-j**5==x:
            print(i,j)
            exit()

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

for x in range(100000):
    if 2 * x ** 5 == X:
        print(x, -x)
        sys.exit()
    for y in range(x):
        if (x ** 5 - y ** 5) == X:
            print(x, y)
            sys.exit()
        if (-x ** 5 + y ** 5) == X:
            print(-y, -x)
            sys.exit()
    tmp = 0
    y = 0
    while tmp < X:
        tmp = x ** 5 + y ** 5
        if tmp == X:
            print(x, -y)
            sys.exit()
        y += 1

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

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

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

Solution (Python):
import itertools

X = int(input())

for a, b in itertools.product(range(128), range(-128, 128)):
  if(a ** 5 - b ** 5 == X):
    print(a, b)
    break

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

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

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

Solution (Python):
x=int(input())
ans=""
flg=0
for i in range(150):
    for j in range(-150,150):
        if i**5-j**5==x:
            ans=str(i)+" "+str(j)
            flg=1
            break
    if flg==1:
        break
print(ans)

Solution (Python):
from math import pow
X = int(input())
for A in range(-120, 120):
    for B in range(-120, 120):
        if int(pow(A, 5)) - int(pow(B, 5)) == X:
            print(A, B)
            exit()

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

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

Solution (Python):
X = int(input())
 
for a in range(-119 , 120 , 1):
  A = a**5
  for b in range(-119 , 120 , 1):
    B = b**5
    if(A-B==X):
      print(a, b)
      exit()
    else:
      continue

Solution (Python):

import sys
sys.setrecursionlimit(10**7)


X = int(input().rstrip())

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

Solution (Python):
X = int(input())
 
flag = 0
A = 0
B = 0
 
for i in range(-120, 120):
  for j in range(-120, 120):
    if i**5 - j**5 == X:
      A = i
      B = j
      break
    elif i**5 + j**5 == X:
      A = i
      B = -j
      break
    elif -i**5 - j**5 == X:
      A = -i
      B = j
      break
print(str(A) + ' ' + str(B))

Solution (Python):
x=int(input())
for i in range(-1000,1000,1):
  for j in range(-1000,1000,1):
    if i**5-j**5==x:
      print(i,j)
      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):
import sys
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

x=INT()

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

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):
x = int(input())
flag = False
for i in range(-119,119,1):
    for j in range(-119,119,1):
        if i**5 - j**5 == x:
            print('{} {}'.format(i, j))
            flag = True
            break
    if flag:
        break

Solution (Python):
def i():
    return int(input())
def i2():
    return map(int,input().split())
def s():
    return str(input())
def l():
    return list(input())
def intl():
    return list(int(k) for k in input().split())

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

Solution (Python):


import itertools


X = int(input())


def get_value(A: int, B: int) -> int:
    """関数

    Arguments:
        A {int} -- 整数
        B {int} -- 整数

    Returns:
        int -- 整数
    """
    return A**5 - B**5


def main() -> None:
    """Entry point
    """
    
    """
    "X = A^5 - B^5"について増加スピードが最も遅い"A - B = 1"の場合について考える。
    このとき、数列"a_n = n^5 - (n-1)^5"はn=-119, 120のときにXの最大値10^9を超えるため、
    -118 <= A <= 119の場合についてのみ考える。
    この不等式とA - B = 1より、-119 <= B <= 118であるため、これらの範囲内のA, Bについて全探索を行う。
    """
    A_min, A_max = -118, 119
    B_min, B_max = -119, 118
    result = ""
    for A, B in itertools.product(range(A_min, A_max+1), range(B_min, B_max+1)):
        value = get_value(A, B)
        if value == X:
            result = f"{A} {B}"
            break

    
    print(result)


if __name__ == "__main__":
    main()

Solution (Python):


import itertools


X = int(input())




def get_value(A: int, B: int) -> int:
    return A**5 - B**5


A_min, A_max = -118, 119
B_min, B_max = -119, 118
result = ""
for A, B in itertools.product(range(A_min, A_max+1), range(B_min, B_max+1)):
    value = get_value(A, B)
    if value == X:
        result = f"{A} {B}"
        break


print(result)

Solution (Python):
import math

X = int(input())
flag = 0

for i in range(119,-119,-1):
  for j in range(119,-119,-1):
    if (pow(i,5) - pow(j,5)) == X:
      flag = 1
      break
  if flag == 1:
    break
print(i,j)

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

Solution (Python):
"""
A^5 - B^5
= (A - B)(A^4 + A^3*B + A^2*B^2 + A*B^3 + B^4)
= (A - B){(A + B) * (A^3 + B^3) + A^2*B^2}
= (A - B){(A + B)^2 * (A^2 - AB + B^2) + A^2*B^2}

(A + B)^2 > 0, (A^2 - AB + B^2) > 0, A^2*B^2 > 0
-> (A - B) > 0
"""


def main():
    print(*solve())


def solve():
    X = int(input())
    N = 10 ** 9 + 7

    step = 2 if X % 2 else 1  

    for x in range(1, N, step):  
        if X % x:  
            continue

        for a in range(N):
            b = a - x

            diff = X - (a ** 5 - b ** 5)
            if diff == 0:
                return a, b

            if diff < 0 < b:
                break


if __name__ == "__main__":
    main()

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

from collections import deque

X = int(input())
s = {}
q = deque()
q.append((1, 0))
done = {(1, 0)}

while True:
	ab = q.popleft()
	tx = ab[0] ** 5 - ab[1] ** 5
	
	if (tx == X):
		print(ab[0], ab[1])
		quit()
	elif (tx > X):
		if ((ab[0] - 1, ab[1]) not in done):
			q.append((ab[0] - 1, ab[1]))
			done.add((ab[0] - 1, ab[1]))
		if (ab[1] > 0 or (ab[0], ab[1] + 1) not in done):
			q.append((ab[0], ab[1] + 1))
			done.add((ab[0], ab[1] + 1))
		if (ab[1] <= 0 or (ab[0], ab[1] - 1) not in done):
			q.append((ab[0], ab[1] - 1))
			done.add((ab[0], ab[1] - 1))
	else:
		if ((ab[0] + 1, ab[1]) not in done):
			q.append((ab[0] + 1, ab[1]))
			done.add((ab[0] + 1, ab[1]))
		if (ab[1] <= 0 or (ab[0], ab[1] - 1) not in done):
			q.append((ab[0], ab[1] - 1))
			done.add((ab[0], ab[1] - 1))

Solution (Python):
"""
A^5 - B^5
= (A - B)(A^4 + A^3*B + A^2*B^2 + A*B^3 + B^4)
= (A - B){(A + B) * (A^3 + B^3) + A^2*B^2}
= (A - B){(A + B)^2 * (A^2 - AB + B^2) + A^2*B^2}

-> (A + B)^2 > 1, (A^2 - AB + B^2) > 1, A^2*B^2 > 1.
"""


def main():
    print(*solve())


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

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


if __name__ == "__main__":
    main()

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)
            exit()
        else:
            pass

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

while True:
    b = 0
    b2 = 0
    while a**5 - b**5 > 0 or a**5 - b2**5 < 10**9:
        if a**5 - b**5  == x:
            print(a ,b)
            break
        b += 1
        if a**5 - b2**5 == x:
            print(a ,b2)
            break
        b2 -= 1
    else:
        a += 1
        continue
    break

Solution (Python):
n=int(input())
x=0
while True:
    if (x+1)**5-x**5>10**9:
        x+=1
        break
    x+=1
for i in range(-x,x):
    for j in range(-x,x):
        if i**5-j**5==n:
            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:
            print(i, j)
            quit()

Solution (Python):
import sys
a=int(input())
for i in range(151):
  b=i**5-a
  c=abs(b)
  j=0
  while j**5<=c:
    if j**5==c:
      if b>=0:
        print(i,j)
        sys.exit()
      else:
        print(i,-j)
        sys.exit()
    j+=1

Solution (Python):
import sys
a=int(input())
for i in range(151):
  b=i**5-a
  c=abs(b)
  j=0
  while j**5<=c:
    if j**5==c:
      if b>=0:
        print(i,j)
        sys.exit()
      else:
        print(i,-j)
        sys.exit()
    j+=1

Solution (Python):
from __future__ import division, print_function
import sys
if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

import os, sys, bisect, copy
from collections import defaultdict, Counter, deque

if os.path.exists('in.txt'): sys.stdin=open('in.txt','r')
if os.path.exists('out.txt'): sys.stdout=open('out.txt', 'w')

def input(): return sys.stdin.readline()
def mapi(arg=0): return map(int if arg==0 else str,input().split())

x = int(input())
def power(x,y):
    res = 1
    
    while y>0:
        if y%2:
            res*=x
        x*=x
        y//=2
        
    return res
def bs(n):
    l = -250
    r = 250
    while r-l>=0:
        mid = (l+r)//2
        tmp = power(mid,5)
        if tmp==n:
            return True, mid
        elif tmp<n:
            
            l = mid+1
        else:
            r = mid-1
    if power(l,5)==n:
        return True,l
    elif power(r,5)==n:
        return True,r
    return False,0
for i in range(-250,250):
    key = power(i,5)-x
    f,b = bs(key)
    if f:
        print(i,b)
        break

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

Solution (Python):
X = int(input())
L = []
for i in range(120):
	L.append(i ** 5)
x = 0
for a in L:
	if a < X:
		b = X - a
		if b in L:
			B = -L.index(b)
			break
	else:
		b = a - X
		if b in L:
			B = L.index(b)
			break
A = L.index(a)
print(A, B)

Solution (Python):
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())
for a in range(120):
    for b in range(-120, 120):
        if a ** 5 - 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)
            exit()

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

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())
LISt=(make_divisors(x))
maX=max(LISt)
n=len(LISt)
flag = False

for i in range(1000):
  for j in range(n):
    b=-LISt[j]+i
    if i**5-b**5==x:
      flag=True
      print(i,b)
      break
  if flag:
    break

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

l = [i for i in range(-1000, 1000)]
c = itertools.permutations(l, 2)
for a, b in c:
    if a**5 - b**5 == X:
        print(a, b)
        break

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

def main():
    x = int(input())
    for i in range(-1000, 1000):
        for j in range(-1000, 1000):
            if x == i**5 - j**5:
                print(i, j)
                break
        else:
            continue
        break

if __name__ == '__main__':
    main()

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

Solution (Python):
x = int(input())
k = 1
while True:
    if k ** 5 - (k-1) ** 5 > x:
        break
    k += 1
for a in range(k):
    amari = x - a ** 5
    for b in range(a+1):
        if amari == b ** 5:
            print(a, -b)
            break
        if amari == (-b) ** 5:
            print(a, b)
            break

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

Solution (Python):
n, = map(int, input().strip().split())



def check(x):
  for a in range(200):
    b = a - x
    c = a**4 + a**3 * b + a**2 * b**2 + a * b**3 + b**4
    d = x * c
    if d == n:
      return [a, b]
  return None

for i in range(1, n+1):
  res = check(i)
  if res:
    break

r1, r2 = res
print(r1, r2)

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


from typing import Iterable


def calc(a: int, b: int) -> int:
    return a ** 5 - b ** 5


def fifthroot(i: int) -> int:
    return int(pow(i, 1 / 5))


def search_b(x, a) -> (bool, int):
    b = int(pow(abs(a ** 5 - x), 1 / 5))
    if x == a ** 5 - b ** 5:
        return True, b
    elif x == a ** 5 + b ** 5:
        return True, -b
    else:
        return False, 0


def main() -> None:
    X = ri()
    predict = fifthroot(X)
    for a in range(predict - 100, predict + 100):
        success, b = search_b(X, a)
        if success:
            break
    wm((a, b))


def r() -> str:
    return input().strip()


def ri() -> int:
    return int(r())


def rmi(delim: str = ' ') -> int:
    return tuple(map(int, input().split(delim)))


def w(data) -> None:
    print(data)


def wm(data: Iterable) -> None:
    print(' '.join(list(map(str, data))))


if __name__ == '__main__':
    main()

Solution (Python):
x = int(input())
import sys
for a in range(1000):
  for b in range(1000):
    if (a ** 5 - b ** 5) == x:
      print(str(a)+" "+str(b))
      sys.exit()
    elif(a ** 5 - (-b) ** 5) == x:
      print(str(a)+" "+str(-b))
      sys.exit()
    elif((-a) ** 5 - b ** 5) == x:
      print(str(-a)+" "+str(b))
      sys.exit()
    elif((-a) ** 5 - (-b) ** 5) == x:
      print(str(-a)+" "+str(-b))
      sys.exit()

Solution (Python):
def main():
    fac = 2**11
    l_a=[]
    for i in range(-fac,fac+1):
        l_a.append(i**5)
    l_b = l_a
    ans = int(input())
    
    A=0
    B=0
    for num_a, i in enumerate(l_a):
        for num_b, j in enumerate(l_b):
            if i - j == ans:
                A = num_a - fac
                B = num_b - fac
    print(A,B)
main()

Solution (Python):
import itertools

X=int(input())
for A,B in itertools.product(range(150),range(-150,150)):
    if (A**5-B**5==X):
        print(A, B)
        break

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

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

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

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

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

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

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

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 math

X = int(input())


def explor_B(A):
    tmp = X - A**5

    def hantei(add_val):
        B = 0
        while True:
            if abs(B**5) == abs(tmp):
                return True, B
            elif abs(B**5) > abs(tmp):
                return False, 0
            else:
                B += add_val  

    if tmp < 0:
        return hantei(1)
         
    else:
        return hantei(-1)


A = 0

while True:
    flag, B = explor_B(A)
    if flag:
        break
    else:
        A += 1

print("{} {}".format(A, B))

Solution (Python):
import math

X = int(input())


def explor_B(A):
    tmp = X - A**5
    if tmp < 0:
        B = 0
        while True:
            if abs(B**5) == abs(tmp):
                return True, B
            elif abs(B**5) > abs(tmp):
                return False, 0
            else:
                B += 1  
    else:
        B = -1
        while True:
            if abs(B**5) == abs(tmp):
                return True, B
            elif abs(B**5) > abs(tmp):
                return False, 0
            else:
                B -= 1  

A = 0

while True:
    flag, B = explor_B(A)
    if flag:
        break
    else:
        A += 1

print("{} {}".format(A, B))

Solution (Python):
import numpy as np


x = int(input())
cands = np.arange(-120,120)
for a in cands:
    for b in cands:
        if a**5 - b**5 == x:
            print(a, b)
            break
    else:
        continue
    break

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

Solution (Python):
import numpy as np
X = int(input())
flag = 1
for c in range(1, np.power(10, 9)):
    x = X
    if x % c == 0:
        x = x // c
        for a in range(np.power(10, 3)):
            b = a-c
            y = 0
            for i in range(5):
                y += np.power(a, 4 - i) * np.power(b, i)
            if y == x:
                print(a, a - c)
                flag = 0
                break
    if flag == 0:
        break

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

Solution (Python):
def main():
  x = int(input())
  for a in range(130):
    for b in range(-63, a):
      if a**5 - b**5 == x:
      	return a, b
      
print(*main())

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

a = 0
b = -1

while True:
    a5 = pow(a, 5)
    b5 = pow(b, 5)
    if(a5-b5 == x):
        print("{} {}".format(a, b))
        break
    if(a5+b5 == x):
        print("{} {}".format(a, -b))
        break
    if(-a5-b5 == x):
        print("{} {}".format(-a, b))
        break
    if(-a5+b5 == x):
        print("{} {}".format(-a, -b))
        break

    b += 1
    if(a==b-1):
        a +=1
        b =0

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

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

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

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

Solution (Python):
x=int(input())
c=0
for i in range(-130,130):
    if c==1:
        break
    for j in range(-130,130):
        if i**5-j**5==x:
            print(i,j)
            c=1
            break

Solution (Python):
import math
x = int(input())
foo = 0;
for i in range(-120 , 120):
  if foo == 1:
      break;
  for j in range(-120 , 120):
    if(math.pow(i , 5) - math.pow(j , 5) == x):
      print(i , " " , j)
      foo = 1;
      break;

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

Solution (Python):
import numpy as np

x = int( input() )

for a in range( -130, 130 ):
    for b in range( -130, 130 ):
        f = a**5 - b**5

        if f == x:
            print( a, b )
            exit()

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


if __name__ == '__main__':
    q4()

Solution (Python):
x = int(input())
for diff in range(1, 250):
  a = 1
  while True:
    b = a-diff
    val = a**5 - b**5
    if val == x:
      print(a,b)
      exit(0)
    if b > 0 and  val > x:
      break
    a += 1
print(-1)

Solution (Python):
X=int(input())
I=J=0
for i in range(-300,300):
  for j in range(-300,300):
    if i**5-j**5==X:
      I=i
      J=j
      break
print(I,J)

Solution (Python):
import bisect


x = int(input())

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

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

Solution (Python):
X=int(input())
k=breaknum=1
while(True):
    for n in range(-118,120):
        x=n**5-(n-k)**5
        if X==x:
            print("{0} {1}".format(n,n-k))
            breaknum=-1
            break
    k+=1
    if breaknum==-1:
        break

Solution (Python):
from sys import stdin, stdout
rl = lambda: stdin.readline()
rll = lambda: stdin.readline().split()

def main():
	x = int(rl())
	for a in range(-200, 201):
		for b in range(-200, 201):
			if a**5-b**5 == x:
				ans = " ".join([str(a), str(b)])
				stdout.write(ans);stdout.write("\n")
				stdout.close()
				return 

if __name__ == "__main__":
	main()

Solution (Python):
import sys
import re
import math
import collections
import decimal
import bisect







INF = sys.maxsize


ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))





def main():
    x = ni()

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




if __name__ == '__main__':
    main()

Solution (Python):
import sys
import re
import math
import collections
import decimal
import bisect







INF = sys.maxsize


ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))





def main():
    x = ni()

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




if __name__ == '__main__':
    main()

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

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

for a in range(-120, 120):
    for b in range(-120, 120):
        if pow(a, 5) - pow(b, 5) == x:
            print(a, b)
            sys.exit(0)

Solution (Python):

import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

X = ir()

A = np.arange(-300, 300, dtype=np.int64)
A5 = A ** 5
B = np.subtract.outer(A5, A5)
index = np.where(B == X)
a = index[0][0] - 300
b = index[1][0] - 300
assert a ** 5 - b ** 5 == X
print(a, b)

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

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

for i in range(-118, 120):
    if ok > 0:
        break
        
    for j in range(-118, 120):
        if i**5 - j**5 == x:
            print(i, j)
            ok += 1
            break

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

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


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

Solution (Python):
import sys

x = int(input())

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

Solution (Python):
def main():
    X = int(input())
    for a in range(-500, 501):
        for b in range(-500, 501):
            if a**5 - b**5 == X:
                print(a, b)
                return


if __name__ == "__main__":
    main()

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

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

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

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

Solution (Python):
import sys
import math
x = int(input())
for i in range(-120,120):
    for j in range(-120,i):
        if (i ** 5 - j ** 5 == x):
            print(i,j)
            sys.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 0


if __name__ == '__main__':
    main()

Solution (Python):
from sys import stdin
r = 0

for i in range(500):
    if i ** 5 - (i - 1) ** 5 > 10 ** 9:
        r = i

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

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

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

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    x=int(input())
    for a in range(-118,120):
        for diff in range(1,238):
            if a**5-(a-diff)**5>10**9:
                break
            if a**5-(a-diff)**5==x:
                print(a,a-diff)
                sys.exit()

if __name__=='__main__':
    main()

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    x=int(input())
    for a in range(-118,120):
        for diff in range(238):
            if a**5-(a-diff)**5>10**9:
                break
            if a**5-(a-diff)**5==x:
                print(a,a-diff)
                sys.exit()

if __name__=='__main__':
    main()

Solution (Python):
from sys import stdin

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

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

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