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

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


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

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


if __name__ == '__main__':
    main()

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

alist=[i for i in range(121)]
blist=copy.deepcopy(alist)

for a in alist:
    for b in blist:
        if a**5 - b**5 == x:
            print(a,b)
            sys.exit()
        elif a**5 + b**5 == x:
            print(a,-b)
            sys.exit() 


print(";;")

Solution (Python):
import math
x = int(input())
a = []
for i in range(1,int(math.sqrt(x))+1):
    if x % i == 0:
        a.append(i)
for j in range(len(a)):
    for k in range(int(math.sqrt(x))+1):
        y = k - a[j]
        if (k-y) * (k**4 + y * k**3 + (k**2)*(y**2) + k * (y**3) + y **4) == x:
            print(k,y)
            exit()

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

for a in range( 10001 ):
    for b in range( a + 1 ):
        if a ** 5 + b ** 5 == x:
            print( str( a ) + " " + str( -b ) )
            exit()
        elif a ** 5 - b ** 5 == x:
            print( str( a ) + " " + str( b ) )
            exit()

Solution (Python):
x = int(input())
a = 0
f = False
res = 0


while f == False:
    for i in range(a+1):
        if (a ** 5) - (i ** 5) == x:
            f = True
            res = i
            break
        elif (a ** 5) - (-i ** 5) == x:
            f = True
            res = -i
            break    
    a += 1

print(str(a-1) + " " + str(res))

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

    for a in range(-2000, 2001):
        for b in range(-2000, 2001):
            if a**5 - b**5 == X:
                return f'{a} {b}'
    return None

print(d_i_hate_factorization())

Solution (Python):
def f(a, b5, rev=False):
    ok = -1
    ng = 300
    while ng - ok > 1:
        mid = (ng+ok)//2
        if N[mid] == b5:
            print(a, mid - 300)
            exit()
        elif N[mid] > b5:
            ng = mid
        else:
            ok = mid
    

N = [i**5 for i in range(-300,300)]
X = int(input())
for a in range(-300,300):
    b5 = N[a + 300] - X
    f(a, b5)

Solution (Python):
import bisect,sys
import math
from collections import deque

def sRaw():
    return input().rstrip("\r")


def iRaw():
    return int(input())


def ssRaw():
    return input().split()


def isRaw():
    return list(map(int, ssRaw()))

INF = 1 << 29

DIV = (10**9) + 7

def mod_inv_prime(a, mod=DIV):
    return pow(a, mod-2, mod)


def mod_inv(a, b):
    r = a
    w = b
    u = 1
    v = 0
    while w != 0:
        t = r//w
        r -= t*w
        r, w = w, r
        u -= t*v
        u, v = v, u
    return (u % b+b) % b


def CONV_TBL(max, mod=DIV):
    fac, finv, inv = [0]*max, [0]*max, [0]*max
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, max):
        fac[i] = fac[i-1]*i % mod
        inv[i] = mod - inv[mod % i] * (mod//i) % mod
        finv[i] = finv[i-1]*inv[i] % mod

    class CONV:
        def __init__(self):
            self.fac =fac
            self.finv = finv
            pass

        def ncr(self, n, k):
            if(n < k):
                return 0
            if(n < 0 or k < 0):
                return 0
            return fac[n]*(finv[k]*finv[n-k] % DIV) % DIV
        
    return CONV()


def cumsum(As):
    s = 0
    for a in As:
        s+=a
        yield s


sys.setrecursionlimit(200005)


def main():
    X = iRaw()
    yakusus = []
    for x in range(1,int(math.sqrt(X))+1):
        if X%x ==0:
            yakusus.append(x)
    a = 1
    while True:
        a5 = a**5
        for y in yakusus:
            b = a -y
            b5 = b**5
            if a5-b5==X:
                return " ".join([str(a),str(b)])
        a+=1


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

Solution (Python):
if __name__ == '__main__':
    a = int(input())
    ansdict= {}
    count = 1000
    mcount =1000 *(-1)

    for i in range(0,1000):
        c = i **5
        ansdict[i]=c
        ansdict[i*(-1)]=c*(-1)
    flag = 0

    for i in range(mcount+1,count):
        for j in range(mcount+1,count):
            ans = ansdict[j]-ansdict[i]
            if ans ==a:
                print(str(j) + " " +str(i))
                flag+=1
                break
        if flag == 1:
            break

Solution (Python):
def main():
    paramX = int(input())
    size = 200
    for a in range(size * -1, size):
        for b in range(size * -1, size):
            if pow(a, 5) - pow(b, 5) == paramX:
                print(a, b)
                return
    print(1, 1)
main()

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

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

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

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

T = [None] * 121
for i in range(121):
    T[i] = i ** 5

ok = False
for a in range(121):
    for b in range(0, 120):
        if T[a] - T[b] == X:
            ok = True
            print(a, b)
            break
    for b in range(0, 121):
        if T[a] + T[b] == X:
            ok = True
            print(a, -b)
            break
    if ok:
        break

Solution (Python):

x = int(input())

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

Solution (Python):
import sys
sys.setrecursionlimit(1000000000)
import math
from math import gcd
def lcm(a, b): return a * b // gcd(a, b)
from itertools import count, permutations, chain
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
INF = float('inf')
N1097 = 10**9 + 7

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

def get_inv(n, modp):
    return pow(n, modp-2, modp)

def factorials_list(n, modp):    
    fs = [1]
    for i in range(1, n+1):
        fs.append(fs[-1] * i % modp)
    return fs

def invs_list(n, fs, modp):     
    invs = [get_inv(fs[-1], modp)]
    for i in range(n, 1-1, -1):
        invs.append(invs[-1] * i % modp)
    invs.reverse()
    return invs

def comb(n, k, modp):
    num = 1
    for i in range(n, n-k, -1):
        num = num * i % modp
    den = 1
    for i in range(2, k+1):
        den = den * i % modp
    return num * get_inv(den, modp) % modp

def comb_from_list(n, k, modp, fs, invs):   
    return fs[n] * invs[n-k] * invs[k] % modp



class UnionFindEx:
    def __init__(self, size):
        
        self.roots = [-1] * size
    def getRootID(self, i):
        r = self.roots[i]
        if r < 0:   
            return i
        else:
            r = self.getRootID(r)
            self.roots[i] = r
            return r
    def getGroupSize(self, i):
        return -self.roots[self.getRootID(i)]
    def connect(self, i, j):
        r1, r2 = self.getRootID(i), self.getRootID(j)
        if r1 == r2:
            return False
        if self.getGroupSize(r1) < self.getGroupSize(r2):
            r1, r2 = r2, r1
        self.roots[r1] += self.roots[r2]    
        self.roots[r2] = r1
        return True

Yes = 'Yes'
No = 'No'

def main(X=None):
    if X is None:
        X = ii()
    for a in range(-100000, 100000):
        b5 = a**5 - X
        b = meg(lambda v: v**5<=b5, -10000000, 10000000)
        if a**5 - X == b**5:
            print(a, b)
            return

main()

Solution (Python):
import sys
import itertools
if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
x=int(input())
l=[]
for a in range(-1000,1000):
	for b in range(-1000,1000):
		p=a**5-b**5
		if p==x:
			l.append([a,b])

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

Solution (Python):
X = int(input())
C = 0
for i in range(-1000,1000):
	if C == 1:
		break
	for j in range(-1000,1000):
		if i**5-j**5 == X:
			print(i,j)
			C += 1
			break

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

a = 1
b = 0
y = 1

while y != x:
    if y > x:
        if a - b == 1:
            break
        b += 1
    else:
        a += 1
    y = a**5 - b**5

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

num = 1
while num**5 < x:
    num += 1
num -= 1


for a in range(num, 0, -1):
    start = 1
    stop = a
    while start < stop:
        b = (start + stop) // 2
        y = a**5 + b**5
        if y == x:
            print(a, -b)
            exit()
        elif y < x:
            start = b + 1
        else:
            stop = b - 1
    if a**5 + start**5 == x:
        print(a, -start)
        exit()

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

m = 1000
bs = {}
for i in range(0, m + 1):
    bs[i ** 5] = i
    bs[i ** 5 * -1] = -i


for a in range(-m, m + 1):
    b = a ** 5 - x
    if b in bs:
        print(a, bs[b])
        exit(0)

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

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

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

a = 1
b = 1
for i in range(-200, 200):
  for j in range(-200, 200):
    if ((i ** 5) - (j ** 5) == n):
      a = i
      b = j

print("%d %d" %(a, b))

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

Solution (Python):
X = int(input())
MAX = 150
al = []
for i in range(MAX):
    al.append(i**5)
    al.append(-i**5)

for i,A in enumerate(al):
    for j,B in enumerate(al):
        if(A-B==X):
            a = i//2 if i%2==0 else -(i//2)
            b = j//2 if j%2==0 else -(j//2)
            print("{} {}".format(a,b))
            exit(0)

Solution (Python):
import sys
import math  
import bisect  
import queue  


def input():
    return sys.stdin.readline().rstrip()


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

    B = 0
    res = {}
    while True:
        b = B ** 5
        if b not in res:
            res[b] = B
        if -b not in res:
            res[-b] = -B
        if X + b in res:
            return print(res[X + b], B)
        if X - b in res:
            return print(res[X - b], -B)
        B += 1


if __name__ == '__main__':
    main()

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


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


def main():
    X = int(input())
    M = 120
    A = [i**5 for i in range(M)]

    for i in range(M):
        for j in range(i, M):
            if A[j] - A[i] == X:
                print(j, i)
                break
            elif A[j] + A[i] == X:
                print(j, -i)
                break

    return


if __name__ == '__main__':
    main()

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

M=130

for i in range(-130,130):
    for j in range(-130,130):
        if i**5-j**5==X:
            print(i,j)
            break
    else:
        continue
    break

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

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

Solution (Python):

def solve(x):
    for b in xrange(-200, 200):
        a5 = (b ** 5) + x
        s = -1 if a5 < 0 else 1
        a = s * int(pow(abs(a5), 0.2) + 0.1)
        if a ** 5 == a5:
            return a, b

def test(x):
    a, b = solve(x)
    assert x == (a ** 5 - b ** 5)

test(33)
test(1)

from random import randint
for i in xrange(100):
    a = randint(-10 ** 3, 10 ** 3)
    b = randint(-10 ** 3, 10 ** 3)
    u = a ** 5 - b ** 5
    if abs(u) > 10 ** 9:
        continue
    test(a ** 5 - b ** 5)


x = int(raw_input())
a, b = solve(x)
print a, b

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

for i in range(1000):
    for j in range(1,1000):
        tmp = (i*i*i*i*i) + (j*j*j*j*j)
        if x == tmp:
            a = i
            b = -j
            break

for i in range(1000):
    for j in range(1,1000):
        tmp = (i*i*i*i*i) - (j*j*j*j*j)
        if x == tmp:
            a = i
            b = j
            break

print(a,b)

Solution (Python):

import sys
from itertools import combinations_with_replacement


def solve(X: int):
    xs = [i for i in range(-180, 181)]
    
    L = list(combinations_with_replacement(xs, 2))
    for l in L:
        l5 = (pow(l[0], 5), pow(l[1], 5))
        if max(l5) - min(l5) == X:
            print("{0} {1}".format(max(l), min(l)))
            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):
import sys
input = sys.stdin.readline
x = int(input())
for a in range(2000):
    for b in range(-2000, a):
        if a**5 - b**5 == x:
            print(a, b)
            sys.exit()

Solution (Python):
X = int(input())
ans = 0
flag = False
for a in range(1000):
    for b in range(-1000,a):
        if a**5-b**5==X:
            ans = (a,b)
            flag = True
            break
    if flag:
        break
print(*ans)

Solution (Python):
X=int(input())
L1=[]
Hash={}
for i in range(300+1):
    L1.append(i**5)
    Hash[i**5]=i
FLAG=0
for i in L1:
    for j in L1:
        if i-j==X:
            print(Hash[i],Hash[j])
            FLAG=1
            break
        elif i+j==X:
            print(Hash[i],-Hash[j])
            FLAG=1
            break
    if FLAG==1:
        break

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

Solution (Python):
x=int(input())
for A in range(10**5):
    k=A**5-x
    if k>=0:
        l=int(k**0.2)
        if l**5==k:
            print(A,l)
            break
    else:
        k=-k
        l=int(k**0.2)
        if l**5==k:
            print(A,-l)
            break

Solution (Python):
x = int(input())
fives = []
for i in range(130):
    fives.append(i**5)

a = 0
b = 0
for i in range(len(fives)):
    for j in range(len(fives)):
        if fives[i] - fives[j] == x:
            a = i
            b = j
        elif fives[j] - fives[i] == x:
            a = j
            b = i
        elif fives[i] + fives[j] == x:
            a = i
            b = -1*j

print(str(a) + " " + str(b))

Solution (Python):
x = int(input())
lis = []
for i in range(-120, 121):
    lis.append(i**5)
flag = False
for i in range(1, len(lis)):
    for j in range(i):
        if lis[i] - lis[j] == x:
            print("{} {}".format(-120 + i, -120+j))
            flag = True
        if flag:
            break
    if flag:
        break

Solution (Python):
import sys, bisect, math, itertools, string, queue, copy


from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
from fractions import gcd

sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])
 
def main():
    x = inp()
    for a in range(-10**3,10**3):
        for b in range(-10**3,a):
            if a**5-b**5 == x:
                print(a,b)
                return
    
if __name__ == "__main__":
    main()

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

Solution (Python):
x=int(input())
x5=[i**5 for i in range(0,10**3+1,1)]
for i in range(len(x5)):
    for j in range(len(x5)):
        if x5[i]-x5[j]==x:
            print(i,j)
            exit()
        if -x5[i]+x5[j]==x:
            print(-i,-j)
            exit()
        if x5[i]+x5[j]==x:
            print(i,-j)
            exit()
        if -x5[i]-x5[j]==x:
            print(-i,j)
            exit()

Solution (Python):
import itertools


def calc(num):
    abs_result = abs(num) ** (1/5)
    if num < 0:
        return int(-abs_result)
    else:
        return int(abs_result)


X = int(input())

s = set()
for i in range(0, 150):
    s.add(i**5)
    s.add(-i**5)

for comb in itertools.combinations(s, 2):
    if comb[0] - comb[1] == X:
        A = calc(comb[0])
        B = calc(comb[1])
        print(A, B)
        break
    if comb[1] - comb[0] == X:
        A = calc(comb[1])
        B = calc(comb[0])
        print(A, B)
        break

Solution (Python):

def resolve():
    X= int(input())
    nums = dict()
    for A in range(10**4):
        nums[A**5] = A
        nums[-A**5] = -A        

        if A**5 - X in nums:
            print(A,nums[A**5-X])
            break
    



    

if __name__ == "__main__":
    resolve()

Solution (Python):
X = int(input())
A = 0
while True:
    if A**5 -(A-1)**5 > X:
        break
    A += 1
B = A
while True:
    Y = A ** 5 - B ** 5
    if Y == X:
        break
    elif Y < X:
        B -= 1
    elif Y > X:
        A -= 1
        B = A
print(A, B)

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

breakflag = False

a = 0
b = 0

for i in range(1000):
    for j in range(i):

        if x == i ** 5 + j ** 5:
            a = i
            b = -j
            breakflag = True
            break

        elif x == i ** 5 - j ** 5:
            a = i
            b = j
            breakflag = True
            break

    if breakflag:
        break

output = ' '.join([str(a), str(b)])
print(output)

Solution (Python):
X = int(input())
a = 500
b = 500
for a_ in range(-a, a):
    for b_ in range(-b, b):
        if a_ ** 5 - b_ ** 5 == X:
            print(a_, b_)
            exit()
print("oops")

Solution (Python):
dat = {}

for i in range(0, 500):
	for j in range(0, 500):
		res = i ** 5 - j ** 5
		dat[res] = [i, j]
		res = i ** 5 + j ** 5
		dat[res] = [i, -j]

tmp = int(input())
if tmp in dat:
	print(dat[tmp][0], dat[tmp][1])

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

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

for t in range(200):
    for b in range(200):
        ans = t * (b**4*5 + b**3*t*10 + b**2*t**2*10 + b*t**3*5 + t**4)
        if X == ans:
            a = b + t
            print(str(a) + " " + str(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)
                exit()

    print('No')


def test():
    for i in range(-10, 11):
        for j in range(-10, 11):
            print(i**5-j**5)


if __name__ == "__main__":
    main()

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

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

Solution (Python):
X = int(input())
a_fifth = {i ** 5 : i for i in range(700)}
b_fifth = {i ** 5: i for i in range(-1000, 1001, 1)}
for bf in b_fifth:
    if X + bf in a_fifth and bf < X + bf:
        print(a_fifth[X + bf], b_fifth[bf])
        exit()

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

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

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

def main():
  X = int(input())
  Y = factorization(X)
  flg = 0
  for con in Y:
    N = con[0]
    M = con[1]
    for i in range((N//2) + 1, (10**9)+1):
      A = i
      B = i - N
      K = (A**4) + ((A**3)*B) + ((A**2)*(B**2)) + (A*(B**3)) + (B**4)
      if K > M:
        break
      elif K == M:
        print('{} {}'.format(A, B))
        flg = 1
        break
    if flg == 1:
      break
main()

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

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

Solution (Python):
n=int(input())
d=dict()
for i in range(300):
    for j in range(300):
        d[i**5-j**5]=(i,j)
        d[i**5+j**5]=(i,-j)
a,b=d[n]
print(a,b)

Solution (Python):
x=int(input())
A=[]
C=[]
for i in range(100000):
    A.append((i)**5)
    C.append((-(i))**5)
for i in range(len(A)):
    for j in range(len(A)):
        if x==A[i]-A[j]:
            print(i,j)
            
            
            exit()
        elif x==A[i]-C[j]:
            print(i,-(j))
            
            
            exit()

Solution (Python):

X = int(input())
for a in range(-200, 200):
    find = False
    for b in range(-200, 200):
        x = a**5-b**5
        if x == X:
            find = True
            print(a, b)
            break
    if find:
        break

Solution (Python):
def solve(x):
    for i in range(1001):
        for j in range(-1001,1001):
            if i**5-j**5==x:
                return (i,j)
            
def main():
    x=int(input())
    Ans=solve(x)
    print(*Ans)
    
if __name__=='__main__':
    main()

Solution (Python):
def binarySearch(arr, l, r, key):
    if r>=1:
        m = (l+r)//2
        if arr[m] == key:
            return m
        elif arr[m] > key:
            return binarySearch(arr, l, m, key)
        else:
            return binarySearch(arr, m+1, r, key)
    else:
        return -1

n = 1000
positive_arr = [elm**5 for elm in range(n)]
negative_arr = [-elm for elm in positive_arr]
arr = negative_arr
arr.extend(positive_arr)

x = int(input())
negative_a, negative_b, printed = False, False, False
for a in arr:
    for b in arr:
        if a - b == x:
            if a<0:
                a *= -1
                negative_a = True
            if b<0:
                b *= -1
                negative_b = True
            a = int(a**(1/5))
            b = int(b**(1/5))
            if negative_a:
                a *= -1
            if negative_b:
                b *= -1
            print(a,b)
            printed = True
            break
    if printed:
        break

Solution (Python):
X = int(input())
for i in range(0, 500):
    for j in range(0, 500):
        if i*i*i*i*i-j*j*j*j*j == X:
            print(i, j)
            quit()
        if i*i*i*i*i+j*j*j*j*j == X:
            print(i, -j)
            quit()

Solution (Python):
import math


def task(x):
    table = {}
    for i in range(-1000, 1000):
        table[i] = int(math.pow(i, 5))

    for i in range(-1000, 1000):
        for j in range(-1000, 1000):
            if table[i] - table[j] == x:
                print(i, j)
                return
    print(0, 0)


x = int(input())

task(x)

Solution (Python):
def main():
  x=int(input())
  for a in range(-250,251):
    for b in range(-250,251):
        if pow(a,5)-pow(b,5)==x:
            print(a,b)
            exit()
main()

Solution (Python):


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

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

if __name__ == "__main__":
    main()

Solution (Python):



x=int(input())

for b in range(10**3):
    a = int((x+b**5)**(1/5))
    for i in range(a-1000,a+1000):
        if i**5+b**5==x:
            print(i,-b)
            exit()
for b in range(10**3):
    a2=(x-b**5)
    if a2<0:
        continue
    a = int(a2**(1/5))
    
    for i in range(a-1000,a+1000):
        if i**5-b**5==x:
            print(i,b)
            exit()

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

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

Solution (Python):
(X,) = [int(x) for x in input().split()]

M = 10 ** 5
fifthRoot = {}
for i in range(-M, M + 1):
    fifthRoot[i ** 5] = i

for b5 in fifthRoot.keys():
    if b5 + X in fifthRoot:
        a5 = b5 + X
        a = fifthRoot[a5]
        b = fifthRoot[b5]
        assert a ** 5 - b ** 5 == X
        print(a, b)
        exit()

Solution (Python):
import math
def main():

    X = int(input())
    v = int(pow(X, 0.25)) + 1
    for A in range(-v, v+1):
        c = pow(A, 5)
        for B in range(-v, v+1):
            if c - pow(B, 5) == X:
                return " ".join(map(str, [A, B]))
    return -1


if __name__ == '__main__':
    print(main())

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

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

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

Solution (Python):
from sys import exit
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 a in range(1,1000):
    end=0
    for b in range(-1000,1000):
        if a**5-b**5 == x:
            end=1
            break
    if end==1:
        break

print(str(a)+' '+str(b))

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 sys
stdin = sys.stdin
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

X=int(input())
ans=[0]*2
for i in range(0,1000):
    for j in range(i+1,1001):
        if(j**5-i**5==X):
            ans[0]=j
            ans[1]=i

for i in range(0,1001):
    for j in range(i+1,1001):
        if(j**5+i**5==X):
            ans[0]=j
            ans[1]=-i


print(*ans)

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

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

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

_range = int(pow(X,1/5))
for i in range(-2*_range-1,2*_range+2):
  for j in range(-2*_range-1,2*_range+2):
    if pow(i,5) - pow(j,5) == X:
      ans_a = i
      ans_b = j
      break
      
print(ans_a,ans_b)

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

Solution (Python):
def main():
    x = int(input())
    for a in range(10**3):
        b = abs(a**5 - x)**0.2
        if a**5 - round(b)**5 == x:
            print(a, round(b))
            break
        if a**5 - round(-b)**5 == x:
            print(a, round(-b))
            break

if __name__ == '__main__':
    main()

Solution (Python):
import sys
import math
import collections
from collections import deque
from functools import reduce
import heapq
x = int(input())




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

Solution (Python):
X = int(input())
Alist = []
Blist = [0]
flag = 0
for i in range(1,10**4):
  Alist.append(i)
for j in range(1,10**4):
  Blist.append(j)
  Blist.append(-j)
for i in range(len(Alist)):
  for j in range(len(Blist)):
    if(Alist[i]**5 - Blist[j]**5 == X):
      print(Alist[i],Blist[j])
      flag = 1
      break
  if(flag==1):
    break

Solution (Python):
X = int(input())
for i in range(1, int(10**(9/2)) + 1):
  for j in range(-200, 200):
    if i**5 - j**5 == X:
      print(i, j)
      exit()

Solution (Python):
x = int(input())
lis = []
for i in range(-150,151):
    lis.append(i**5)
tab = [[0]*301 for _ in range(301)]
for j in range(301):
    for k in range(301):
        tab[j][k] = lis[j]-lis[k]
for l in range(301):
    for m in range(301):
        if tab[l][m] == x:
            print(l-150, m-150)
            exit()

Solution (Python):
from sys import stdin
import sys

X = int(input())
for i in range(-5000, 5001):
    for k in range(-5000, 5001):
        if i-k != 0 and (X/(i-k)).is_integer():
            if i**5-k**5 == X:
                print(i, k)
                sys.exit()

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

n = 500

for i in range(-n, n + 1):
    flag = False
    for j in range(-n, n + 1):
        if i == j:
            continue
        if i ** 5 - j ** 5 == X:
            print(i, j)
            exit()

Solution (Python):
x = int(input())
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors
make_divisors(10**9)
for i in range(0,200):
  for j in range(0,200):
    if i**5+j**5 == x:
      print(i,-j)
      quit()
l = make_divisors(x)
for i in l:
  b = 0
  a = b+i
  if (a**5-b**5)%10 != x%10:
    continue
  while True:
    a = b+i
    if a**5-b**5 < x:
      b += 1
    elif a**5-b**5 > x:
      break
    else:
      print(a,b)
      quit()
print(l)

Solution (Python):
import math


def read():
    X = int(input())
    return X, 


def f(a, b):
    return a**5 - b**5


def solve(X):
    for i in range(0, 1001):
        for j in range(-1000, 1001):
            if f(i, j) == X:
                return "{} {}".format(i, j)

if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    print("{}".format(outputs))

Solution (Python):
x = int(input())
target_ls = [0]
base = 1
base_ls = [0]
while True:
    new = (base)**5
    target_ls.append(new)
    target_ls.append(-new)
    base_ls.append(base)
    base_ls.append(-base)
    target_ls.sort()
    base_ls.sort()
    if target_ls[-1] - target_ls[-2] > 10**9:
        break
    base += 1
len_target= len(base_ls)
for i,a in enumerate(base_ls):
    for j,b in enumerate(base_ls):
        if target_ls[i] - target_ls[j] == x:
            ans = [a,b]
print(ans[0],ans[1])