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):
n=int(input())
for i in range(-121,121):
    for j in range(-121,121):
        if i**5 - j**5 == n:
            print(i, j)
            exit(0)

Solution (Python):
import sys

x = int(input())
flag = False
a = 0

while True:
    for b in range(-a+1,a):
        if  a ** 5 - b  ** 5 == x:
            print(a,int(b))
            sys.exit()
    a += 1

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

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

Solution (Python):
import sys

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

for i in A:
    for a in range(1, int(X**0.5)+1):
        b = a - i[0]
        if a**4 + a**3*b + a**2*b**2 + a*b**3 + b**4 == i[1]:
            print(a, b)
            sys.exit()

Solution (Python):
X = int(input())
for i in range(-130,130):
    A = i**5
    for j in range(-130,130):
        if A-j**5 == X:
            print('{0} {1}'.format(i,j))
            exit()

Solution (Python):
import itertools

X = int(input())

limit = 10 ** 13
check = [0]
now = 1
add = 1
while add < limit:
    add = now ** 5
    minus_add = add * -1
    check.append(add)
    check.append(minus_add)
    now += 1
new_array = sorted(check)
len_new_array = len(new_array)
check_combi = list(itertools.combinations(range(len(new_array)), 2))
for x in check_combi:
    
    if new_array[x[0]] - new_array[x[1]] == X:
        print(x[0] - (len_new_array - 1) // 2, x[1] - (len_new_array - 1) // 2)
        break
    if new_array[x[1]] - new_array[x[0]] == X:
        print(x[1] - (len_new_array - 1) // 2, x[0] - (len_new_array - 1) // 2)
        break

Solution (Python):
import sys

def resolve():
    x=int(input())
    i=1
    while 1:
        for j in range(i):
            if x==i**5-j**5:
                print(i,j)
                sys.exit()
            elif x==i**5+j**5:
                print(i, -1*j)
                sys.exit()
        i+=1
resolve()

Solution (Python):
from math import sqrt,ceil,floor
def mi():return map(int,input().split())
def li():return list(mi())
def ii():return int(input())


x=ii()


for i in range(1000000):
    x3=x-pow(i,5)
    x2=abs(x3)
    x1=x2**(1/5)
    x1=int(x1)
    if(pow(x1,5)==x2):
        if(x3>0):
            x1*=(-1)
        print(i,x1)
        break

Solution (Python):
X = int(input())
flag = 0
for A in range(0, 6001):
  if(flag == 1):
    break
  for B in range(-6001, 6001):
    if(flag == 1):
      break
    if(A**5 - B**5 == X):
      print(A, B)
      flag = 1
      break

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

p = 0
while True:
    p += 1
    for i in range(-p,p):
        for j in range(-p,p):
            if i**5 - j**5 == x:
                print (i,j)
                exit ()

Solution (Python):
x = int(input())
for a in range(-int(x**0.3), int(x**0.3) + 1):
    for b in range(-int(x**0.3), int(x**0.3) + 1):
        if a**5 - b**5 == x:
            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):
x=int(input())
flag=False
ansi=0
ansj=0
for i in range(1,65):
    for j in range(-65,1):
        if i**5-j**5==x:
            ansi=i
            ansj=j
            flag=True
            break
    if flag:
        break
if not flag:
    for i in range(1,122):
        for j in range(1,122):
            if i**5-j**5==x:
                ansi=i
                ansj=j
                flag=True
                break
        if flag:
            break
print(str(i)+" "+str(j))

Solution (Python):
x = int(input())
c = 0
for a in range(-1000,1000):
	for b in range(-1000,1000):
		if pow(a,5)-pow(b,5) == x:
			print(a,b)
			c += 1
			break
	if c >= 1:
		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=int(input())
a=0
while a>-1:
  c=-1
  while c<0:
    if a**5-(a+c)**5==X:
      print(str(a)+" "+str(a+c))
      exit()
    elif a**5-(a+c)**5>X:
      break
    c-=1
  a+=1

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

for l in range(1,2*(10**4)):
    a =l
    mod = (a%10-X%10)%10
    for b in range(mod,a+1,10):
        if a**5 - b**5 == X:
            print(a,b)
            sys.exit()
    mod = (X%10-a%10)%10
    for b in range(mod,a+1,10):
        if a**5 + b**5 == X:
            print(a,-b)
            sys.exit()

Solution (Python):

def solve():
    X = int(input())
    for i in range(500):
        for j in range(-500,500):
            if i**5 -j**5 == X:
                print(i,j)
                break
        else:
            continue
        break

if __name__ == '__main__':
    solve()

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

can = []
for a in range(10**3):
    a5 = a**5
    if not a5 in can:
        can.append(a5)

result = []
for a in can:
    for b in can:
        if a - b == x:
            ans = "{} {}".format(int(a**(1/5)),int(b**(1/5)))
            if not ans in result:
                result.append(ans)
        if a + b == x and a > b:
            ans = "{} {}".format(int(a**(1/5)),int(-1 * b**(1/5)))
            if not ans in result:
                result.append(ans)

for r in result:
    print(r)

Solution (Python):
from math import floor
from math import ceil
X = int(input())

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

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

li = []
for i in range(-150,150):
    li.append((i**5, i))

for i in li:
    for j in li:
        if i[0] - j[0] == x:
            print(i[1], j[1])
            exit()

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

oil = []
for i in range(500,-1,-1):
    oil.append(pow(-(i),5))

for i in range(500):
    oil.append(pow((i+1),5))

cnt = -500


for i in oil:
    cnt_2 = -500
    for j in oil:
        if i-j == x:
            print(cnt,cnt_2)
            exit()
        cnt_2 +=1
    cnt += 1

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

    return divisors

yaku = make_divisors(X)
def fun(x, a):
    return(5*x**4-10*a*x**3+10*a**2*x**2-5*a**3*x+a**4)


for one in yaku:
    for i in range(10**5):
        if fun(i, one)==X/one:
            print(i, i-one)
            exit()

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

def check():
    for i in range(1000):
        for j in range(1000):
            if i**5 + j**5 == X:
                print(i, -j)
                return
            elif i**5 - j**5 == X:
                print(i, j)
                break

check()

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

m = 2*10**9
l = []

a = 0
b = 0
p = 0

while p < 1000:
  b = a**5
  l.append(b)
  a += 1
  p += 1


flg = 0
for i in range(len(l)):
  
  if flg == 1:
    break
  for j in range(i+1,len(l)):
    if l[i] + l[j] == x:
      res = [i,-j]
      flg = 1
      break
    elif l[i] - l[j] == x:
      res = [i,j]
      flg = 1
      break
    elif -l[i] + l[j] == x:
      res = [-i,-j]
      flg = 1
      break
    elif -l[i] - l[j] == x:
      res = [-i,j]
      flg = 1
      break
      
      
print(res[0],res[1])

Solution (Python):
import sys
import numpy as np

x = int(input())

a = np.arange(255)
b = a**5
for i in range(255):
    for j in range(255):
        if b[i] + b[j] == x:
            print(i, -j)
            sys.exit()
        if b[i] - b[j] == x:
            print(i, j)
            sys.exit()

Solution (Python):
X = int(input())
for b in range(0, 10000):
    a5p = X + b**5
    a5m = X - b**5
    for a in range(abs(b)+1, 10000):
        a5 = a**5
        if a5 == a5p:
            b = b
            break
        elif a5 == a5m:
            b = -b
            break
    else:
        continue
    break

print(a, b)

Solution (Python):
x=int(input())
li=[]

for i in range(-1000,1000):
    li.append([i,i**5])

step=len(li)

for j in range(step):
    for k in range(step):
        if li[j][1]-li[k][1]==x:
            print(li[j][0],li[k][0])
            exit()

Solution (Python):
X = int(input())
A = 0
B = 0
for b in range(-500, 500):
    for a in range(b+1, 500):
        if a**5 - b**5 == X:
            A, B = a, b

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

Solution (Python):
import sys
input=sys.stdin.readline
X = int(input().rstrip('\n'))
a = 0
check = 0
while X>a**5:
  b1 = X-a**5
  b2 = b1**0.2
  b = float('{:.5f}'.format(b2))
  if b.is_integer():
    print(a,int(b)*(-1))
    check += 1
    break
  else:
    a +=1
while check < 1:
  b1 = a**5-X
  b2 = b1**0.2
  b = float('{:.5f}'.format(b2))
  if b.is_integer():
    print(a,int(b))
    break
  else:
    a +=1

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


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

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

gojo = []
i = 0
ans = 0
while ans <= 1000000000000000000:
    ans = i**5
    gojo.append(ans)
    i += 1

risou = 0
for j, B in enumerate(gojo):
    risou = B + X
    mirisou = X - B
    for k in range(j,len(gojo)):
        if gojo[k] == risou:
            print(k, j)
            exit()
        elif gojo[k] == mirisou:
            print(k, -j)
            exit()
        if gojo[k] > risou and gojo[k] > mirisou:
            break

Solution (Python):
import numpy as np
import sys
import math
read = sys.stdin.readline

X = int(input())


for a in range(1,1000):
    for b in range(0,1000):
        a4 = a ** 4
        b4 = b ** 4
        a3 = a ** 3
        b3 = b ** 3
        a2 = a ** 2
        b2 = b ** 2
        if ( (a-b)*( a4 + (a3*b) + (a2 * b2) + (b3 * a) + b4) ) == X:
            print(a,b)
            sys.exit()

        b = -1 * b
        b3 = -1 * b3
        if ( (a-b)*( a4 + (a3*b) + (a2 * b2) + (b3 * a) + b4) ) == X:
            print(a,b)
            flag = 1
            sys.exit()

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

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

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

flag =0

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

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

N = 10**9
ab=[]
a = 0
b = 0
while len(ab) < 2:
  a += 1
  b = 0
  for i in range(a):
    
    if X % (a-b)==0:
      
      c = a ** 5 - b ** 5
      if c == X :
        ab.append(a)
        ab.append(b)
      if X*(-1) == c:
        ab.append(a)
        ab.append(b)
    b = -b
    if X % (a-b)==0:
      c = a ** 5 - b ** 5
      if c == X :
        ab.append(a)
        ab.append(b)
      if X*(-1) == c:
        ab.append(a)
        ab.append(b)
    b = -b + 1


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

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

Solution (Python):
N = 200
fac = [0]*(N)
for i in range(N):
    fac[i] = pow(i,5)


X = int(input())
for a in range(N):
    for b in range(N):
      if fac[a] - fac[b] == X:
          print(a,b)
          exit()
      if -fac[a] - fac[b] == X:
          print(-a,b)
          exit()
      if fac[a] + fac[b] == X:
          print(a,-b)
          exit()
      if -fac[a] + fac[b] == X:
          print(-a,-b)
          exit()

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

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

Solution (Python):
X = int(input())
for A in range(0, 10**9):
    tmp = A**5 - X
    if tmp == 0:
        print(A, 0)
    elif tmp > 0:
        B = int(abs(tmp)**0.2)
        if tmp == B**5:
            print(A, B)
            break
    else:
        B = -int(abs(tmp)**0.2)
        if tmp == B**5:
            print(A, B)
            break

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

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


X = int(input())

divisor = make_divisors(X)

for i in divisor:
    if i % 2 == 0:
        A = i // 2
    else:
        A = (i + 1) // 2
    
    ans = 0
    while(ans <= X):
        ans = A ** 5 - (A - i) ** 5
        if ans == X:
            print(A, A - i)
            exit()
        A += 1

Solution (Python):
x = int(input())
i = 1
while True:
    for j in range(i):
        if i**5 == x + j**5:
            print(str(i) + " " + str(j))
            exit()
        elif i**5 == x - j**5:
            print(str(i) + " " + str(-j))
            exit()
    i += 1

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

A = 0
B = 0
test = 10**3
for i in range(-test, test):
	a = (X + i**5)**0.2
	if type(a) == float:
		if round(a, 10).is_integer():
			A, B = int(a), i
			break
print(A, B)

Solution (Python):
import itertools
from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush,heapify
import math
from copy import deepcopy
import queue

Mod = 1000000007
  
def sieve_of_eratosthenes(n):
    if not isinstance(n,int):
        raise TypeError("n is not int")
    if n<2:
        raise ValueError("n is not effective")
    prime = [1]*(n+1)
    for i in range(2,int(math.sqrt(n))+1):
        if prime[i] == 1:
            for j in range(2*i,n+1):
                if j%i == 0:
                    prime[j] = 0
    res = []
    for i in range(2,n+1):
        if prime[i] == 1:
            res.append(i)
    return res

 
class UnionFind:
    def __init__(self,n):
        self.parent = [i for i in range(n+1)]
        self.rank = [0 for i in range(n+1)]
    
    def findroot(self,x):
        if x == self.parent[x]:
            return x
        else:
            y = self.parent[x]
            y = self.findroot(self.parent[x])
            return y
    
    def union(self,x,y):
        px = self.findroot(x)
        py = self.findroot(y)
        if px < py:
            self.parent[py] = px
        else:
            self.parent[px] = py
 
    def same_group_or_no(self,x,y):
        return self.findroot(x) == self.findroot(y)

def main():  
    x = int(input())
    for i in range(-500,501):
        for j in range(-500, 501):
            if i ** 5 - j ** 5 == x:
                print(i, j)
                exit()
if __name__ == "__main__":
    main()

Solution (Python):
x=int(input())
a=0
while True:
    b=a**5-x
    if b<0:
        b=-((-b)**(1/5))
    else:
        b=b**(1/5)
    c=int(b)
    if (a**5-c**5)==x:
        print(str(a)+" "+str(c))
        break
    a+=1

Solution (Python):
import numpy as np
import math
import scipy as sp
import queue
import collections

MOD = 10 ** 9 + 7
INF = 10 ** 9

def main(kwargs):
    x = kwargs["x"]
    n = int(x ** 0.25) + 1
    R = [[0 for i in range(n)] for i in range(n)]
    done = False

    for i in range(n):
        R[0][i] = i ** 5
        R[i][0] = i ** 5

    for i in range(0, n):
        for j in range(i + 1, n):
            R[i][j] = R[0][j] - R[0][i]

            if R[i][j] == x:
                res = '{} {}'.format(j, i)
                done = True
                break

        for j in range(1, i):
            R[i][j] = R[i][0] + R[j][0]

            if R[i][j] == x:
                res = '{} {}'.format(i, -j)
                done = True
                break

        if done:
            break

    return res

if __name__ == "__main__":
    kwargs = {}

    cin = input().split()
    
    
    kwargs["x"] = [int(i) for i in cin][0]
    

    cout = main(kwargs)
    print(cout)

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

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

sele = math.floor(x ** (1/4))

for j in range(-sele, sele + 1):
    for k in range(-sele, sele + 1):
        if f(j, k) == x:
            print(j, k)
            exit()

Solution (Python):
x = int(input())
i = 0
num = []
for i in range(-1000,1000):
    num.append(i)
    i += 1
for i in range(2000):
    for j in range(2000):
        if num[i]**5 - num[j]**5 == x:
            print(num[i],num[j])
            exit()

Solution (Python):
from copy import copy, deepcopy
from collections import Counter
from math import sqrt, floor, factorial
from itertools import permutations, combinations, combinations_with_replacement
from operator import mul
from functools import reduce

MOD = 10**9 + 7
INF = float('inf')

X = int(input())
flag = 0
if X == 0:
    print("0 0")
    exit()

for i in range(1, int(1 + sqrt(X))):
    if flag == 1:
        exit()
    elif X % i == 0:
        B = 0
        while B**4 < X+1 and flag == 0:
            if ((B+i)**5 - B**5 == X) or (((-1*B+i)**5 + B**5 == X)):
                if ((B+i)**5 - B**5 == X):
                    print("{} {}".format(B+i, B))
                    flag = 1
                else:
                    print("{} {}".format(-1*B+i, -1*B))
                    flag = 1
            B += 1

Solution (Python):
import math
import itertools

X = int(input())

list = [0]

for i in range(1000):
    val = i**5
    list.append(val)

if X % 2 == 0 and X // 2 in list:
    print(int(math.pow(X//2, 1/5)), -int(math.pow(X//2, 1/5)))
elif X in list:
    print(int(math.pow(X, 1/5)), 0)
else:
    for i in itertools.combinations(list, 2):
        
        if i[0] + i[1] == X:
            print(int(math.pow(i[0], 1/5)), -int(math.pow(i[1], 1/5)))
            break
        elif i[0] - i[1] == X:
            print(int(math.pow(i[0], 1/5)), int(math.pow(i[1], 1/5)))
            break
        elif i[0] + i[1] == X:
            print(int(math.pow(i[0], 1/5)), -int(math.pow(i[1], 1/5)))
            break
        elif i[1] - i[0] == X:
            print(int(math.pow(i[1], 1/5)), int(math.pow(i[0], 1/5)))
            break

Solution (Python):
X = int(input())
p5 = [i**5 for i in range(3000)]
p5s = set(p5)
M = 299**5
A = 0
while True:
    B5 = abs(A**5 - X)
    if B5 in p5s:
        B = p5.index(B5) if A**5 >= X else -p5.index(B5)
        print(A, B)
        exit()
    A += 1

Solution (Python):
def m():
    X = int(input())
    length = 1001
    plus = [pow(i, 5) for i in range(0, length)]
    minas = [pow(i, 5) for i in range(-(length-1), 1)]
    minas.reverse()

    for i in range(length):
        for s in range(length):
            if (plus[i] - plus[s]) == X:
                return f'{i} {s}'

        for t in range(length):
            if (plus[i] - minas[t]) == X:
                return f'{i} {-t}'

    for i in range(length):
        for s in range(length):
            if (minas[i] - plus[s]) == X:
                return f'{-i} {s}'

        for t in range(length):
            if (minas[i] - minas[t]) == X:
                return f'{-i} {-t}'


print(m())

Solution (Python):
import math

X = int(input())

for i in range(1001):
    f = round((X + i ** 5) ** 0.2)
    if f ** 5 - i ** 5 == X:
        print(int((X + i ** 5) ** 0.2), i)
        exit()

for i in range(1, 1001):
    f = round(abs(X - i ** 5) ** 0.2)
    if X - i ** 5 > 0:
        if f ** 5 - (-i) ** 5 == X:
            print(f, -i)
            exit()
    else:
        if (-f) ** 5 - (-i) ** 5 == X:
            print(-f, -i)
            exit()

Solution (Python):
x = int(input())
for i in range(1, 10 ** 5):
    i5 = i ** 5
    flag = False
    for j in range(i):
        j5 = j ** 5
        if i5 + j5 == x:
            flag = True
            print(i, -j)
            break
        elif i5 - j5 == x:
            flag = True
            print(i, j)
    if flag:
        break

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

def f(x):
    return x**5

def idx(i):
    if(i%2==0): return i//2
    else: return -(i//2)

five = []
for i in range(200):
    five.append(f(i))
    five.append(f(-i))


res = [0, 0]
flg = False
for i in range(400):
    for j in range(400):
        a = five[i]
        b = five[j]
        
        if(a - b == x):
            res = [idx(i), idx(j)]
            flg = True
            break
    if flg:
        break
        

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

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

A = 0
while True:
    n = X - A ** 5
    if n == 0:
        print(A, 0)
    elif n > 0:
        B = int(n ** (1 / 5))
        if B ** 5 == n:
            print(A, -B)
            break
        B += 1
        if B ** 5 == n:
            print(A, -B)
            break
        A += 1
    else:
        B = - int((-n) ** (1 / 5))
        if B ** 5 == n:
            print(A, -B)
            break
        B -= 1
        if B ** 5 == n:
            print(A, -B)
            break
        A += 1

Solution (Python):
x = int(input())
def check(i):
    a = 1
    while True:
        b = a - i
        temp = pow(a, 5) - pow(b, 5)
        
        if temp == x:
            return (a, b)
        if b > 0 and temp > x:
            return -1
        a += 1

num = int(pow(x, 0.5)//1)
for i in range(1, num + 1):

    if x % i == 0:
        temp = check(i)
        if temp == -1:continue
        else:
            print(*temp)
            exit()

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


gap = 1
while True:
    a, b = 0, -gap
    while True:
        if a ** 5 - b ** 5 == x:
            print(a, b)
            exit()
        elif a ** 5 - b ** 5 > x and a > 0 and b > 0:
            break
        else:
            a += 1
            b += 1
    gap += 1

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

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

Solution (Python):
x=int(input())
a=0
b=0
def f(n):
    n1 = n**(1/5)
    if n1==int(n1):
        return True

l=set()
l.add(0)
i=1
while i**5<100*x:
    i1=i**5
    l.add(i1)
    if i%2==1:
        l.add(-i1)
    i+=1

for i in l:
    b=i
    a=x+b
    if a in l:
        if a!=0 and b!=0:
            a1=(a/abs(a))*(abs(a)**(1/5))
            b1=(b/abs(b))*(abs(b)**(1/5))
            print(int(a1),int(b1))
        elif b==0:
            a1=(a/abs(a))*(abs(a)**(1/5))
            print(int(a1),0)
        else:
            b1=(b/abs(b))*(abs(b)**(1/5))
            print(0,int(b1))
        break

Solution (Python):
x = int(input())
s = []
flag = 0

for i in range(-200, 200):
    s.append(i**5)

a = -200

for n in s:
    b = -200
    for m in s:
        if n-m == x:
            print(a,b)
            flag = 1
            break
        if flag:
            break
        b += 1

    a += 1

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)
    divisors.sort()
    return divisors

x = int(input())
ans = 0
k = make_divisors(x)
for i in k:
    j = x//i
    l, r = 0, x
    flag = False
    while r-l > 1:
        key = (r+l)//2
        a, b = key+i, key
        if a**4+a**3*b+a**2*b**2+a*b**3+b**4 == j:
            ans = (a, b)
            flag = True
            break
        elif(a**4+a**3*b+a**2*b**2+a*b**3+b**4) > j:
            r = key 
        else:
            l = key
    if flag:
        break
    a, b = l+i, l
    if a**4+a**3*b+a**2*b**2+a*b**3+b**4 == j:
        ans = (a, b)
        flag = True
        break
    a, b = r+i, r
    if a**4+a**3*b+a**2*b**2+a*b**3+b**4 == j:
        ans = (a, b)
        flag = True
        break

if ans == 0:
    for i in range(1, 100):
        for j in range(1, 100):
            if i**5+j**5 == x:
                ans = (i, -j)
                break
        if ans != 0:
            break
    pass

print(*ans)

Solution (Python):
import math
from collections import Counter
x=int(input())
a=0
b=0
l=[]
for i in range(0,201):
	l.append(pow(i,5))
f=True
for i in range(len(l)):
	if not f:
		break
	for j in range(len(l)):
		if not f:
			break
		if l[i]-l[j]==x:
			print(i,j)
			f=False
		elif l[i]+l[j]==x:
			print(i,-j)
			f=False

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

    _n = int(x ** .2)
    for n in range(_n-2, _n+3):
        if n ** 5 == x:
            print(n, 0)
            return
    
    for i in range(1, 100):
        if x - i ** 5 < 0:
            continue
        _n = int((x - i ** 5) ** .2)
        for n in range(_n-2, _n+3):
            if n ** 5 == (x - i ** 5):
                print(i, -n)
                return
    
    for i in range(1, 1000):
        fif = x + i ** 5
        _n = int(fif ** .2)
        for n in range(_n-2, _n+3):
            if n ** 5 == fif:
                print(n, i)
                return

main()

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

i = 0
p = 0
d = {}
while True:
    d[i] = i**5
    if d[i] - p > X*2:
        break
    p = d[i]
    i+=1

rd = list(d.items())
rd.reverse()


for p in range(len(rd)):
    k, v = rd[p]

    for q in range(p+1, len(rd)):
        kn, vn = rd[q]

        if v - vn == X:
            print(k, kn)
            exit()
        elif v + vn == X:
            print(k, kn*-1)
            exit()

Solution (Python):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

x = ii()
l = [0]
i = 0
num = 0
while num < 10**11:
    i += 1
    num = i**5
    l.append(num)

l = set(l)
for item in l:
    if item > x:
        if item - x in l:
            print(int(item**0.2),int((item-x)**0.2))
            exit()
    else:
        if x - item in l:
            print(int(item**0.2),int((x-item)**0.2)*(-1))
            exit()

'''
    if x - item in l:
        print(int(item**0.2),int(abs(item-x)**0.2)*(-1))
        exit()
    elif item - x in l:

        print(int(item**0.2),int(abs(item-x)**0.2)*(-1))
        exit()
'''

Solution (Python):
def div(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
def check(a,b):
    if x == a**5-b**5:
        return 0
    return a**5-b**5    

x = int(input())
s = div(x)
s.sort()
for i in s:
    for j in range(i//2+1):
        if(check(i-j,-j)==0):
            print(i-j,-j)
            exit()
    k = 1        
    while(check(i+k,k)<=x):
        if check(i+k,k)==0:
            print(i+k,k)
            exit()
        k+=1

Solution (Python):



from math import *
from copy import *					
from heapq import *					
from string import *				
from random import *				
from bisect import *				
from sys import stdin				
from sys import maxsize				
from operator import *				
from itertools import *				
from collections import Counter		
from collections import defaultdict 

'''

'''

def solve(x):
	l = []
	d = {}
	for i in range(-1000,1000):
		zz = i**5
		d[zz] = i
		l.append(zz)
	for a in range(-2000,2000):
		zz = a**5
		if(zz - x in l):
			print(a,d[zz-x])
			return

X = int(stdin.readline())
ans = solve(X)

Solution (Python):
x = int(input())
d = []
for i in range(1000):
	d.append( [i,i ** 5] )
	d.append( [ -i, (-i) ** 5 ] )
import sys
for i in d:
	for j in d:
		if i[1] - j[1] == x:
			print(i[0],j[0])
			exit(0)

Solution (Python):
from sys import exit

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

lists = make_divisors(X) 

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

Solution (Python):
import sys
import math
import fractions
from collections import deque
from collections import defaultdict
sys.setrecursionlimit(10**7)

X = int(input())

l = []
for i in range(0, 1000):
    l.append(i ** 5)

for i in range(len(l)):
    for j in range(len(l)):
        if l[i] - l[j] == X:
            print(i, j)
            sys.exit()
        if l[i] + l[j] == X:
            print(i, -j)
            sys.exit()

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

Solution (Python):
def foo():
    for i in range(len(F)):
        for j in range(len(F)):
            if F[i] + F[j] == X:
                print(i, -j)
                return
            if F[i] - F[j] == X:
                print(i, j)
                return
X = int(input())
F = [i**5 for i in range(1000)]
flg = False
foo()

Solution (Python):
import sys
X = int(input())
MOD = 10**9+7
M = [i*m for i in range(0, 10**4) for m in [-1, 1]]
for i in range(0, 10**4):
  for j in M:
    if i == j:
      break
    if X%(i-j)==0:
      if i**5-j**5==X:
        print(i, j)
        sys.exit(0)

Solution (Python):
X = int( input().strip() ) ;

d = {} ;
for x in range ( 150 ) : 
	v1 = pow ( x, 5 ) ; 
	d[x] = v1 ; 
	d[-x] = -v1 ;
ans = None ;
for A in d :
	if not ans is None :
		break ;
	for B in d :
		if d[A] - d[B] == X : 
			ans = ( A, B, ) ; 
			break ;
if not ans is None :
	print ( "{0} {1}".format ( ans[0] , ans[1] ) );

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


for a in range(-1, 20000):
    
    ub = 1000**5
    lb = -1000**5
    while lb + 1 < ub:
        target = (ub+lb)//2
        if a**5 - x == target**5:
            print(a, target)
            exit()
        elif (a**5 - x >= target**5):
            lb = target
        else:
            ub = target
    if a**5 - target**5-x == 0:
        print(a, target)

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

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

Solution (Python):
def f(x):
    a = 0
    
    while True:
        ap = a ** 5
        b = -a
        while True:
            s = ap - b ** 5
            if s > x:
                break
            if s == x:
                return a, b
            b -= 1
        a += 1
        if a ** 5 > x // 2:
            break
    
    while True:
        ap = a ** 5
        for b in range(0, a):
            if ap - b ** 5 == x:
                return a, b
        a += 1


if __name__ == '__main__':
    x = int(input())
    print(' '.join(map(str, f(x))))