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
import itertools
import operator
from functools import reduce  


def solve(X:int):
    for a in range(1, 125):
        for b in range(-125, 125):
            if a ** 5 - b ** 5 == X:
                print(a, b)
                return

def prod(iterable):
    return reduce(operator.mul, iterable, 1)

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

def solve_wrong(X: int):
    insu = [1] + prime_factorize(X)
    N = len(insu)
    ans_a = -99999999
    ans_b = -99999999
    for n in range(N):
        tmp = itertools.combinations(insu, n)
        for t in tmp:
            print(t)
            product = prod(t)
            b = 0
            while True:
                left = (b + product) ** 4 + (b + product) ** 3 * b + (b + product) ** 2 * (b ** 2) + (b + product) * (b ** 3) + b ** 4
                right = X // product
                if left == right:
                    ans_a = b + product
                    ans_b = b
                    break
                if left > right:
                    break
                b += 1
            b = 0
            while True:
                left = (b + product) ** 4 + (b + product) ** 3 * b + (b + product) ** 2 * (b ** 2) + (b + product) * (b ** 3) + b ** 4
                right = X // product
                if left == right:
                    ans_a = b + product
                    ans_b = b
                    break
                if left > right:
                    break
                b -= 1
            if ans_b != -99999999:
                break
        if ans_b > 0:
            break
    print(ans_a, ans_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):
import numpy as np

x = int(input())
flag = False
for a in range(-200,200):
  for b in range(-200,200):
    if a<=b:
      break
    a_5 = np.power(a,5)
    b_5 = np.power(b,5)
    if a_5 - b_5 == x:
      flag =True
      print(a,b)
      break
  if flag:
    break

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

Solution (Python):
def main():
    ans = 0
    x = int(input())
    for i in range(-118,120):
        for j in range(-118, 120):
            if i**5 - j**5 == x:
                ans = [i,j]
                break 
    print(ans[0], ans[1])

if __name__ == '__main__':
    main()

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

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

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

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

Solution (Python):

import sys

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


X = ir()

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

U = 10 ** 4
div = make_divisors(X)
for a in range(U):
    for d in div:       
        b = a - d
        if a ** 5 - b ** 5 == X:
            print(a, b)
            exit()

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

Solution (Python):
x=int(input())
m=0
for i in range(500):
  for k in range(500):
    w=i**5
    e=k**5
    r=k**5*-1
    if w-e==x:
      print(i,end=" ")
      print(k)
      m+=1
      break
    elif w-r==x:
      print(i,end=" ")
      print(k*-1)
      m+=1
      break
  if m==1:
    break

Solution (Python):
X = int(input())
for a in range(0,121):
    for b in range(-121,122):
        if X == a**5-b**5:
            print(a,b)
            break
    else:
        continue
    break

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

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    flag=False
    x=int(input())
    for i in range(-200,200):
        for j in range(-200,200):
            if i**5-j**5==x:
                flag=True
                print(i,j)
                break
        if flag:
            break
resolve()

Solution (Python):
x=int(input())
s={0}
n=1
stop=0
while(1):
    N=n**5
    for i in s:
        if N-i==x:
            if i>0:
                sig=1
            elif i<0:
                sig=-1
            else:
                sig=0
            print(n,int(sig*pow(abs(i),1/5)))
            stop=1
        elif i-N==x:
            if i>0:
                sig=1
            elif i<0:
                sig=-1
            else:
                sig=0
            print(int(sig*pow(abs(i),1/5)),n)
            stop=1
    if stop==1:
        break
    s|={N,-N}
    n+=1

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

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

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

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

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

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

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

import sys

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

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


x = int(input().strip())
abs_x = abs(x)

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

def X_plus(a, b):
    return a**5 + b**5

a = -118
b = -119


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

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

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

Solution (Python):
x = int(input())
for i in range(-150,150):
    for j in range(-150,150):
        if i**5 - j**5 == x:
            A = i
            B = j
            break

print(A,B)

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

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

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

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

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

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

Solution (Python):
X = int(input())
for i in range(-500,501):
    for j in range(-500,501):
        if pow(i,5)-pow(j,5) == X:
            print(i, j)
            exit()

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

Solution (Python):
X = int(input())
for A in range(-198,200):
    for B in range(-119,119):
        if pow(A,5) - pow(B,5) == X:
            print('{} {}'.format(A,B))
            exit()

Solution (Python):
X=int(input())
flag=0
for i in range(-129,129):
  for j in range(-129,129):
    if i*i*i*i*i-j*j*j*j*j==X:
      if flag==0:
        print(i,j)
        flag=1

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

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

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


for a in range(121):
    for b in range(-120,120):
        x = a ** 5 - b ** 5
        if x==N:
            an=str(a)+" "+str(b)
print(an)

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

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

Solution (Python):
import math
X=int(input())
end=False
for i in range(-120,120):
    for j in range(-120,120):
        if pow(i,5) - pow(j,5) == X:
            print(i,j)
            end=True
            break
    if end==True:
        break

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

'''
N**5 - (N-1)**5 <= 1000000000 となるNの絶対値を求めておく

N = 0
while True:
    if N**5 - (N-1)**5 > 1000000000:
        print(N)
        break
    N += 1

N = 120 となるため、-120から120を全探索の範囲にする
'''

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(-118, 120):
    for b in range(-119, 119):
        if a**5 - b**5 == X:
            print(a, b)
            exit()

Solution (Python):

import math
X = int(input())

B = -math.floor(math.pow(X, 0.2))
for b in range(B, 1000):
    a = int(math.pow(X + b ** 5, 0.2))
    if a ** 5 - b ** 5 == X:
        break
        
print(a, b)

Solution (Python):



X = int(input())







flag = False
for ai in range(-119,120):
    for bi in reversed(range(-120,119)):
        if ai - bi != 0 and X > (ai - bi):
            if X % (ai - bi) == 0:
                if ai**5 - bi**5 ==X:
                    print(int(ai),int(bi))
                    flag = True
                    break
        else:
            if ai**5 - bi**5 ==X:
                print(int(ai),int(bi))
                flag = True
                break
    if flag:
        break

Solution (Python):
data = {}
count = 0
max_num = 10**9
before = 0
while True:
    tmp = count**5
    data[count] = tmp
    data[-count] = -tmp
    count+=1
    if tmp - before > max_num:
        break
    before = tmp

x = int(input())
for k, v in data.items():
    for k2, v2 in data.items():
        if v - v2 == x:
            print(k, k2)
            exit()

Solution (Python):



X = int(input())







flag = False
for ai in range(-119,120):
    for bi in range(-120,119):
        if ai - bi != 0 and X > (ai - bi):
            if X % (ai - bi) == 0:
                if ai**5 - bi**5 ==X:
                    print(int(ai),int(bi))
                    flag = True
                    break
        else:
            if ai**5 - bi**5 ==X:
                print(int(ai),int(bi))
                flag = True
                break
    if flag:
        break

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







flag = False
for ai in range(-119,120):
    for bi in range(-120,119):
        if ai - bi != 0 and X > (ai - bi):
            if X % (ai - bi) == 0:
                if ai**5 - bi**5 ==X:
                    print(int(ai),int(bi))
                    flag = True
                    break
        else:
            if ai**5 - bi**5 ==X:
                print(int(ai),int(bi))
                flag = True
                break
    if flag:
        break

Solution (Python):

import sys
import math

X = int(input())
limit =10**5
a=0
b=0
for b in range(-1*limit ,limit):
    a5 =X+pow(b,5)
    if 0 <= a5: 
        a=math.pow(a5,0.2)
        a_int =int(a)
        dif =a_int**5 -b**5 -X
        if abs(dif)<10**(-5):
            break
    else:
        continue
print(a_int,b)

Solution (Python):

import math
X = int(input())

B = -math.floor(math.pow(X, 0.2))
for b in range(B, 100000):
    tmp = math.pow(X + b ** 5, 0.2)
    if math.floor(int(tmp) - tmp + 1.0e-6) == 0:
        break
        
tmp = int(tmp)
print(tmp, b)

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

Solution (Python):

import math
X = int(input())

B = -math.floor(math.pow(X, 0.2))
for b in range(B, 100000):
    tmp = math.pow(X + b ** 5, 0.2)
    if math.floor(int(tmp) - tmp + 1.0e-6) == 0:
        break
        
tmp = math.floor(tmp + 1.0e-6)
print(tmp, b)

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

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

ans1, ans2 = 0,0
for i in range(-200,200):
    for j in range(-200,200):
        if i**5 - j**5 == x:
            
            ans1, ans2 = i,j

print(ans1,ans2)

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

Solution (Python):
X = int(input())
A = [i**5 for i in range(-118,120)]
A_posi = [i for i in range(-118,120)]
B = [i**5 for i in range(-119,119)]
B_posi = [i for i in range(-119,119)]
result = [0]*2
for i in range(len(A)):
    for j in range(len(B)):
        if A[i] -B[j] ==X:
            result[0] = A_posi[i]
            result[1] = B_posi[j]
            break
print(*result)

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


X = int(input())
A = 0
B = 0
a = a5b5(X)

Solution (Python):

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

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

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

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

resolve()

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

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):
import sys
readline = sys.stdin.readline

def main():
    X = int(readline())
    for a in range(-118, 120):
        for b in range(-118, 120):
            if a ** 5 - b ** 5 == X:
                print(a, b)
                return

if __name__ == '__main__':
    main()

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

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

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


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


divisors = set()
for i in range(1, int(10**9**.5)+1):
    if x % i == 0:
        divisors |= {i, x//i}


for b in range(-1000, 1000):
    for div in divisors:
        a = div+b
        if f(a, b) == x:
            print(a, b)
            exit()

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

Solution (Python):


x = int(input())
n =0
for i in range(-119,120):
    for j in range(-119,120):
        if i**5-j**5 == x:
            print(str(i)+' '+str(j))
            n += 1
            break
        else:
            continue
    if  n !=  0:
        break

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


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


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

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

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

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


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


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

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

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


def checkAndPrint(a, b, x):
    if pow(a, 5) - pow(b, 5) == x:
        print(a, b)
        exit()


for a in range(200):
    for b in range(200):
        checkAndPrint(a, b, x)
        checkAndPrint(-a, b, x)
        checkAndPrint(a, -b, x)

Solution (Python):
N=int(input())
K=120
M=2*K+1
ls=[i-K for i in range(M)]
pow5=[n**5 for n in ls]
f=0
for i in range(M):
  for j in range(i,M):
    if pow5[j]-pow5[i]==N:
      print(*[ls[j],ls[i]])
      f=1
      break
  if f==1:
    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()

Solution (Python):



import sys
sys.setrecursionlimit(10**7)
from pprint import pprint as pp
from pprint import pformat as pf

import math

import bisect


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

def solve(x):
    for a in range(-120, 120):
        for b in range(-120, 120):
            if x == calc(a, b):
                print(a, b)
                return


if __name__ == '__main__':
    x = int(input())
    solve(x)

Solution (Python):
i=0
exec('j=-i;exec("i**5-%s-j**5or exit(print(i,j));j+=1;"*i*2);i+=1;'%input()*200)

Solution (Python):
from itertools import product

X = int(input())
for a, b in product(range(-200, 201), repeat=2):
    if a**5 - b**5 == X: print(a, b); break

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

import sys

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

Solution (Python):

n = int(input())
list_5 = []
a = 0
b = 0
for _ in range(-121,121):
    list_5.append(_**5)
for i in range(-121,121):
    if (n + list_5[i]) in list_5:
        b = i  
        a = list_5.index(n + list_5[i])       
print(a-121, b-121)

Solution (Python):
i=0
exec('j=-i;exec("i**5-%s-j**5or exit(print(i,j));j+=1;"*i*2);i+=1;'%input()*200)

Solution (Python):
exec('x=int(input());i=0;'+'j=-i;exec("i**5-x-j**5or exit(print(i,j));j+=1;"*i*2);i+=1;'*200)

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


def is_ok(A, B, X):
    return A ** 5 - B ** 5 == X


def spiral():
    i = 1
    p = [0, 0]
    yield p
    while True:
        for j in range(i):
            p[0] += 1
            yield p
        for j in range(i):
            p[1] -= 1
            yield p
        i += 1
        for j in range(i):
            p[0] -= 1
            yield p
        for j in range(i):
            p[1] += 1
            yield p
        i += 1


for a, b in spiral():
    if is_ok(a, b, X):
        print(a, b)
        break

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

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

A = -119
while A<= 120:
    B = -119
    while B<= 120:
        if A**5 - B**5 == X:
            print('%d %d'%(A, B))
            break
        B += 1
    else:
        A+= 1
        continue
    break

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

print(a, b)

Solution (Python):

def solve():
    x=int(input())
    for i in range(-1000,1001):
        for j in range(-1000,1001):
            if(i**5-j**5==x):
                print(i,j)
                return
solve()

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

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

X = int(input())
A, B = 0, 0

for i in range(1000):
    for j in range(-1000, 1000):
        x = int(math.pow(i, 5) - math.pow(j, 5))
        if X == x:
            A, B = i, j
            break
print(A,B)

Solution (Python):

"""
Created on Sun May  3 20:56:48 2020
"""

import sys


sys.setrecursionlimit(10 ** 9)


mod = 10**9+7

X = int(input())

for i in range(-5000,5001):
    for j in range(-5000,5001):
        if pow(i,5) - pow(j,5) == X:
            print(i,j)
            sys.exit()

Solution (Python):

"""
Created on Sun May  3 20:56:48 2020
"""

import sys


sys.setrecursionlimit(10 ** 9)


mod = 10**9+7

X = int(input())

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

Solution (Python):

"""
Created on Sun May  3 20:56:48 2020
"""

import sys


sys.setrecursionlimit(10 ** 9)


mod = 10**9+7

X = int(input())

for i in range(-2000,2001):
    for j in range(-2000,2001):
        if pow(i,5) - pow(j,5) == X:
            print(i,j)
            sys.exit()

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

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

Solution (Python):
from scipy import optimize

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

divisors = make_divisors(X)
divisors = divisors + [-x for x in divisors]
for p in divisors:
    def f(x):
        return (x+p)**5 - x**5 - X 
    sol = optimize.fsolve(f, X**(1./5.))
    B = int(round(sol[0]))
    A = B + p
    if A**5 - B**5 == X:
        print(A, B)
        break

Solution (Python):
from scipy import optimize

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

divisors = make_divisors(X)
divisors = divisors + [-x for x in divisors]
for p in divisors:
    def f(x):
        return (x+p)**5 - x**5 - X 
    sol = optimize.fsolve(f, X**(1./5.))
    
    B = int(round(sol[0]))
    A = B + p
    
    if A**5 - B**5 == X:
        print(A, B)
        break

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

Solution (Python):
x = int(input())
max_cand = 120
for a in range(max_cand+1):
    for b in range(max_cand+1):
        if (a**5 - b**5) == x:
            print(a, b)
            break
        elif (a**5 + b**5) == x:
            print(a, -b)
            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)
            exit()

Solution (Python):
x,r=int(input()),range(-99,120);[i**5-x-j**5or exit(print(i,j))for i in r for j in r]

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




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

    flag = False

    for i in range(-118, 120):
        for j in range(-119, 119):
            if i**5- j**5 == x:
                print(i, j)
                flag = True
                break
        if flag:
            break




if __name__ == '__main__':
    main()

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

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





print(*solve())

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(-120, 120):
    for j in range(-120, 120):
        if i ** 5 - j ** 5 == x:
            print(i, j)
            exit()

Solution (Python):
x = int(input())
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
print(a, b)

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

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

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

for a in range(1, 120):
    for b in range(-a, a):
        if pow(a, 5) - pow(b, 5) == x:
            break
    if pow(a, 5) - pow(b, 5) == x:
         break
            
print(a, b)

Solution (Python):
X=int(input())
Ni=0
while (Ni+1) ** 5 - Ni** 5 <= X:
    Ni+=1
    
for i in range(1,Ni+1):
    for ii in range(-i,i):
        if i**5 - ii**5==X:
            break
    else:
        continue
    break

print(i,ii)

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

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

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

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

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

def LI(): return list(map(int, stdin.readline().split()))
def LS(): return list(stdin.readline())

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

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

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

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

boption = []
a = 1
while boption == []:
  for i in divisors:
    b = a - i
    if a**5-b**5 == x:
      boption.append(b)
  a += 1

a -= 1
print("{} {}".format(int(a),int(boption[0])))

Solution (Python):

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

Solution (Python):

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


if __name__ == "__main__":
    main()

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

Solution (Python):
import math
import sys

x = int(input())
r = math.ceil(x ** 0.2)

def reverse_num(x):
    return r - x
def calc_b(aa):
    bb = aa - x
    bbb = abs(bb) ** 0.2
    if bb < 0:
        b = -1
    else:
        b = 1
    
    return b * int(bbb.real + bbb.imag)
def check(a):
    aa = a ** 5
    b = calc_b(aa)
    
    if aa - b ** 5 == x:
        print(a,b)
        return True
    else:
        return False
for a in range(r // 2 + 1):
    if check(a) or check(reverse_num(a)):
        sys.exit()
a = r + 1
while True:
    if check(a):
        sys.exit()
    a += 1

Solution (Python):
x=int(input())
r=range(-99,200)
[i**5-x-j**5or exit(print(i,j))for i in r for j in r]

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