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):
x=int(input())
if x==1:
    print(0,-1)
    exit()
else:
    n5=[0]
    i=1
    for i in range(1,120):
        i5=i*(i*i)**2
        n5.append(i5)
        if abs(x-i5) in n5:
            print(n5.index(i5),-(x-i5)//abs(x-i5)*(n5.index(abs(x-i5))))
            break

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

for A in range(-200,200):
    for B in range(-200,200):
        if(A**5-B**5==X):
            print(A,B)
            break
    else:
        continue
    break

Solution (Python):
import sys

X = int(input())



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

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












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

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

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

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

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

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

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

Solution (Python):


X = int(input())
fact = []
for i in range(300):
    fact.append(pow(i,5))

for i in range(300):
    for j in range(300):
        if fact[i]-fact[j]==X:
            print(i, j)
            break
        elif fact[i]+fact[j]==X:
            print(i, -j)
            break
    else:
        continue
    break

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())
F = make_divisors(X)

S = [int(x) for x in F]

for i in range(len(S)):
    tmp = S[i]
    for A in range(-1000, 1001):
        B = A - tmp
        if A**5 - B**5 == X:
            print(str(A) + ' ' + str(B))
            break
    else:
        continue
    break

Solution (Python):


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

Solution (Python):
N = int(input())
t = []
i=0
s=2
ans1 =0
ans2 =0
while (i**5<10**11):
    t.append(i**5)
    i+=1
for j in t:
    if(N + j) in t:
        ans1 = j
        ans2 = N + j
        s = 0
        break
    elif(N-j) in t:
        ans1 = -j
        if(N-j >0):
            ans2 = N - j
            s = 1
            break
        else:
            ans2 = j - N
            s=1
            break
if(s==0):
    ans3 = t.index(j) 
    ans4 = t.index(ans2)
else:
    ans3 = (t.index(j))*(-1)
    ans4 = t.index(ans2)
print(ans4,ans3)

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

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

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

Solution (Python):
X = int(input())
c = 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)    
            c = 1
            break
    if c != 0:
        break

Solution (Python):
def main():
    import sys
    X=int(sys.stdin.readline())
    for i in range(-1000,1000):
        for j in range(-1000,1000):
            if i**5-j**5==X:
                print("{} {}".format(i,j))
                return
                


main()

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

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

def func():
    for a in range(-10**2 - 200, 10**2 + 200):
        for b in range(-10**2 - 200, 10**2 + 200):
            if a**5 - b**5 == x:
                k = [a, b]
                return k
    

k = func()
for i in range(2):
    print(k[i], end=" ")

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

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

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


for i in div:
  for a in range(0, 10001): 
    b = a - i
    
    if a**5 - b**5 == X:
      print(a, b)
      break
  else:
    continue
  break

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

A = 0
B = 0
for a in range(10**3):
    for b in range(-10**3, 10**3):
        if X == a ** 5 - b ** 5:
            A = a
            B = b
            break
print(A, B)

Solution (Python):
X = int(input())
a = []
b = 0
flag = True
num = 120
if(X <= 120):
  num = X
for i in range(1,num+1):
  if(X%i== 0):
    a.append(i)
while(flag):
  for i in range(len(a)): 
    if(pow(b+a[i],5)-pow(b,5) == X):
      print("%d %d"%(b+a[i],b))
      flag = False
      break
  b -= 1
  if(b < -119):
    b = 119

Solution (Python):




x = int(input())


eflg = False
for a in range(200):
    wk_a = a ** 5
    for b in range(200):
        if wk_a - (b ** 5) == x:
            ans1 = a
            ans2 = b
            eflg = True
            break

        if wk_a - (-b ** 5) == x:
            ans1 = a
            ans2 = -b
            eflg = True
            break

    if eflg == True:
        break


print(ans1, ans2)

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


if __name__ == '__main__':
    main()

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

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

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

y = 1000
s = -1000
t = -1000

a = 0
b = 0

while s < y:
    t = -y
    while t < y:
        if s ** 5 - t ** 5 == x:
            a = int(s)
            b = int(t)
        t += 1
    s += 1

print(a, b)

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

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

Solution (Python):
import sys
import bisect
import numpy as np

x = int(input())
bs = [i for i in range(-100, 200)]
bspow = list(map(lambda x: x**5, bs))


for a in range(200):
    b_calc = a**5 - x
    index = bisect.bisect_left(bspow, b_calc)
    if(bspow[index] == b_calc):
        print(a, bs[index])
        sys.exit(0)

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

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

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

Solution (Python):
from statistics import median


from fractions import gcd
from itertools import combinations 
from collections import deque
from collections import defaultdict
import bisect










import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    X = int(input())
    import math
    for i in range(-119,119):
        for j in range(-119,119):
            if i == j:
                continue
            if X % (i - j) == 0:
                if (i-j) * (pow(i,4) + pow(i,3)*j + pow(i,2)*pow(j,2) + i*pow(j,3) + pow(j,4)) == X:
                    print(i,j)
                    exit()
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(-118,120):
        if a**5-b**5==x:
            print(a,b)
            exit()

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




for a in range(0, 1000):
    for b in range(0, 1000):
        if pow(a, 5)-pow(b, 5) == x:
            print(a, end=" ")
            print(b)
            exit()
        elif pow(a, 5)-pow(b*-1, 5) == x:
            print(a, end=" ")
            print(b*-1)
            exit()
        elif pow(-1*a, 5)-pow(b, 5) == x:
            print(-1*a, end=" ")
            print(b*-1)
            exit()
        elif pow(-1*a, 5)-pow(b*-1, 5) == x:
            print(-1*a, end=" ")
            print(b*-1)
            exit()

Solution (Python):
import sys

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

Solution (Python):
def I(): return int(input())
def LI(): return list(map(int,input().split()))
def MI(): return map(int,input().split())
def LLI(n): return [list(map(int, input().split())) for _ in range(n)]

x = I()
t = 0
for i in range(-1000,1000):
    for j in range(-1000,1000):
        if i**5 -j**5 == x:
            print(i,j)
            t = 1
            break
    if t==1:
        break

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

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

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

Solution (Python):
x = int(input())
if x == 1:
  print(0,-1)
  exit()
  
def divisorize(fct):
    b, e = fct.pop()  
    pre_div = divisorize(fct) if fct else [[]]
    suf_div = [[(b, k)] for k in range(e + 1)]
    return [pre + suf for pre in pre_div for suf in suf_div]


def factorize(n):
    fct = []  
    b, e = 2, 0  
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct


def num(fct):
    a = 1
    for base, exponent in fct:
        a = a * base**exponent
    return a

c = []
fct = factorize(x)
for div in divisorize(fct):
    c.append(num(div))
    
chk = False
for s in c:
  if chk:
    break
  for i in range(1000):
    if (i+s)**5-i**5 > x:
      break
    if (i+s)**5-i**5 == x:
      ans = (i+s,i)
      chk = True
      break
  if s <1000:    
    for p in range(s,1000):
      j = -1*p
      
      if (j+s)**5-j**5 > x:
        break 
      if (j+s)**5-j**5 == x:
        ans = (j+s,j)
        chk = True
        break 
  for ww in range(1,(s+1)//2)[::-1]:
    jj = -1*ww
    if (jj+s)**5-jj**5 > x:
      break    
    if (jj+s)**5-jj**5 == x:
      ans = (jj+s,jj)
      chk = True
      break 
print(*ans)

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

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

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

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

for a in range(-500, 501):
  for b in range(-500, 501):
    if a*a*a*a*a - b*b*b*b*b == X:
      ans_a = a
      ans_b = b
      break
      
print(ans_a, ans_b)

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

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

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

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

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

Solution (Python):
import sys

X = int(input())


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


for a in range(-200, 200):
    for b in range(-200, 200):
        if f(a, b):
            print(a, b)
            sys.exit()

Solution (Python):

import collections
import itertools as it
import math

 

x  = int(input())






for a in range(-500, 500):
    for b in range(-500, 500):
        if (a ** 5) - (b **5) == x:
            print(a, b)
            exit()
"""
for a in range(1, 10**9):
    b = abs((a**5 - x)**(1/5))
    

    if b.is_integer():
        b = int(b)
        if (a ** 5) - (-b ** 5) == x:
            print(a, -b)
        else:
            print(-a, b)

        break
"""

Solution (Python):

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

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

if __name__ == "__main__":
    main()

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

a, b = 0, 0

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

d = make_divisors(x)
d.sort()

for i in d:
    
    a, b = i, 0
    while(b != -1000):
        
        if x == pow(a,5) - pow(b,5):
            print(a, b)
            exit()
        else:
            a -= 1
            b -= 1

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

numbers = dict()

for i in range(-200, 200):
    numbers.setdefault(i, i**5)

for i in range(-200, 200):
    for j in range(-200, 200):
        if numbers[i] - numbers[j] == X:
            output = [i, j]
            break

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

Solution (Python):
import sys
input = sys.stdin.readline
 
 
def main():
    X = int(input().rstrip())
    f = 0
    for a in range(-150, 150):
        for b in range(-150, 150):
            i = a ** 5 - b ** 5
            if i == X:
                print(a, b)
                f = 1
                break
 
        if f:
            break
 
 
if __name__ == '__main__':
    main()

Solution (Python):
X=int(input())
def f(a,b):
  return a**5-b**5

for a in range(-200,200):
  for b in range(-200,200):
    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, 200):
        if a**5 - b**5 == x:
            print(a, b)
            quit()

Solution (Python):
X = int(input())
List = [(A,B) for A in range(-120,120) for B in range(-120,120) if A**5 - B**5 == X]

print(*List[0])

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

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

ans = []

for i in range(-118,120):
  for j in range(-119,119):
    if i ** 5 - j ** 5 == X:
      ans = [i,j]
      break

print(*ans)

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):
import itertools
import numpy as np
X=int(input())
t=0
for i in range(0,1000):
    if t==-1:
        break
    for j in range(-1000,1000):
        
        
        if i**5-j**5==X:
            print(i,end=" ")
            print(j)
            t=-1
            break

Solution (Python):
import itertools

x = int(input())
n = 200
table = [pow(i, 5) for i in range(-n, n+1)]

choices = list(itertools.permutations([i for i in range(len(table))], 2))

for choice in choices:
    left = choice[0]
    right = choice[1]
    if table[left] - table[right] == x:
        if left == n:
            ans_left = 0
        elif left < n:
            ans_left = left - n
        else:
            ans_left = left % n
            
        if right == n:
            ans_right = 0
        elif right < n:
            ans_right = right - n
        else:
            ans_right = right % n
        break

print(ans_left, ans_right)

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

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

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

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

for A in range(-200,200):
  for B in range(-200,200):
    if A*A*A*A*A - B*B*B*B*B == X:
      print(A, B)
      sys.exit()

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

Solution (Python):
x = int(input())
a = []
b = []
ansa = 0
ansb = 0
for i in range(10**3):
    a.append(i**5)
    b.append(i**5)
for i in a:
    for j in b:
        if i - j == x:
            ansa = i**(1/5)
            ansb = j**(1/5)
        elif i + j == x:
            ansa = i**(1/5)
            ansb = -(j**(1/5))
        elif -i + j == x:
            ansa = -(i**(1/5))
            ansb = -(j**(1/5))
        elif -i -j == x:
            ansa = -(i**(1/5))
            ansb = j**(1/5)
print(int(ansa), int(ansb))

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

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

Solution (Python):
def solve():
  X = int(input())
  Fin = False
  for a in range(-1000, 1000):
    for b in range(-1000, 1000):
      if a ** 5 - b ** 5 == X:
        Fin = True
        print(a, b)
        break
    if Fin: break
  return 0
if __name__ == "__main__":
  solve()

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

    for B in range(-200, 201):
        for A in range(-200, 201):
            if A**5 - B**5 == X:
                print(A, B)
                exit()
    
if __name__ == "__main__":
    main()

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

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

A=[]
B=[]

for i in range(120):
    A.append(X+(i)**5)
    B.append(X-(i)**5)

ans1=0
ans2=0

for i in range(120):
    if i**5 in A:
        ans1=i
        ans2=A.index(i**5)
        break
    elif i**5 in B:
        ans1=i
        ans2=-B.index(i**5)
        break

print(ans1,ans2)

Solution (Python):
import sys
import numpy as np
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

X = int(read())

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

Solution (Python):
import math
X = int(input())
N = math.floor(X ** (2/5)) + 1

for a in range(N):
  for b in range(-N,N):
    x = a**5
    y = b**5
    T = 0
    if x-y == X:
      print(a,b)
      T = 1
      break
  if T == 1:
    break

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

a,b = [0,0]
for i in range(-500,501):
    for j in range(-500,501):
        if i**5 - j**5 == x:
            a = i
            b = j
            break

print(a,b)

Solution (Python):
import itertools


X = int(input())
ans_A = 0
ans_B = 0
for i, j in itertools.combinations(range(-120, 120), 2):
    j *= -1
    if i**5 - j**5 == X:
        ans_A = i
        ans_B = j
        break
print(ans_A, ans_B)

Solution (Python):
x=int(input())
fifth_power=[0]*200
for i in range(200):
    fifth_power[i]=(i+1)**5
for i in range(200):
    t=abs(x-fifth_power[i])
    if x==1:
        print(0,-1)
        break
    elif fifth_power.count(t)==1:
        if fifth_power[i]-t==x:
            print(i+1,fifth_power.index(t)+1)
            break
        else:
            print(i+1,-fifth_power.index(t)-1)
            break

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

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

def repeat_any_square( a,n ):
    if n == 1:
        return a
    x = repeat_any_square( a,n//2 )
    x *= x
    if n % 2 == 1:
        x *= a
    return x

ans = []
for i in range(-1000,1000):
    ans.append(repeat_any_square(i,5))


for i in range(2000):
    if ((ans[i] - X) in ans) == True:
        flag_A = 1
        flag_B = 1
        if ans[i] < 0:
            flag_A = -1
        if ans[i] - X < 0:
            flag_B = -1
        print(flag_A*int(math.pow(flag_A*ans[i],1/5)),flag_B*int(math.pow(flag_B*(ans[i]-X),1/5)))

        exit()

Solution (Python):
import itertools

x = int(input())
n = 200
table = [pow(i, 5) for i in range(-n, n+1)]
choices = list(itertools.product([i for i in range(len(table))], repeat=2))

for choice in choices:
    left = choice[0]
    right = choice[1]
    if table[left] - table[right] == x:
        if left == n:
            ans_left = 0
        elif left < n:
            ans_left = left - n
        else:
            ans_left = left % n
            
        if right == n:
            ans_right = 0
        elif right < n:
            ans_right = right - n
        else:
            ans_right = right % n
        break

print(ans_left, ans_right)

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

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

if __name__ == "__main__":
    main()

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

	for a in range(0, 131, 1):
		for b in range(-131, a+1, 1):
			val = a**5 - b**5
			if(val == N):
				print(str(a) + " " + str(b))
				return

if __name__ == "__main__":
	main()

Solution (Python):
X=int(input())
for i in range(-200,201):
    for j in range(-200,201):
        if i**5-j**5==X:
            print(str(i)+" "+str(j))
            break
    else:
        continue
    break

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

main()

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

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

def main():
    x=II()
    s=set()
    etoa={}
    for a in range(1000000):
        s.add(a**5)
        etoa[a**5]=a
    for b in range(1000000):
        t=x+b**5
        if t in s:
            print(etoa[t],b)
            break
        t=x-b**5
        if t<0:continue
        if t in s:
            print(etoa[t],-b)
            break

main()

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

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

Solution (Python):
import itertools
import numpy as np

X = int(input())
maxs = int(X**(1/5))

l = np.arange(-126, 127)

comb = np.array(list(itertools.combinations_with_replacement(l, 2)))

sum1 = comb[:, 0]**5 - comb[:, 1]**5
sum2 = comb[:, 1]**5 - comb[:, 0]**5

if len(np.where(sum1==X)[0]) != 0:
    result1 = np.where(sum1==X)[0][0]
    print(comb[result1][0], comb[result1][1])
else:
    result2 = np.where(sum2==X)[0][0]
    print(comb[result2][1], comb[result2][0])

Solution (Python):
import math

X = int(input())
M = 500

def culc():
  for a in range(-M, M):
    a5 = pow(a, 5)

    for b in range(-M, M):
      b5 = pow(b, 5)

      if(a5 - b5 == X):
        print(" ".join(map(str, [a, b])))
        return

culc()

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



def linput(_t=int):
    return list(map(_t, input().split()))

def gcd(n,m):
    while m: n,m = m, n%m
    return n

def lcm(n,m): return n*m//gcd(n,m)

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

    

    for A in reversed(range(-310,310)):
        for B in reversed(range(-310,310)):
            if A**5 - B**5 == X:
                print(A, B)
                return
    


    

    


main()

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

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

def inputlist(): return [int(k) for k in input().split()]

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

Solution (Python):
x = int(input())
OP = [+1, -1]
for a in range(1000):
    for b in range(a + 1):
        for op1 in OP:
            for op2 in OP:
                if (op1 * a)**5 - (op2 * b)**5 == x:
                    print(op1 * a, op2 * b)
                    exit()

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


X = int(input())
divs = f1(X)
INF = 10 ** 15

for p in divs:
    a = 0
    A = pow(a, 5)
    b = a - p
    B = pow(b, 5)
    while A - B < INF:
        if A - B == X:
            print(a, b)
            exit()
        a += 1
        A = pow(a, 5)
        b = a - p
        B = pow(b, 5)

Solution (Python):
X = int(input())
A = 0
B = 0
flag = 1
while flag:
  B = A * (-1)
  while B < A:
    
    if A*A*A*A*A - B*B*B*B*B == X:
      print(A, B)
      flag = 0
      break
    B = B + 1
  A = A + 1

Solution (Python):

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

Solution (Python):
X=int(input())
ans1=0
ans2=0
for a in range(-(10**3),10**3):
    for b in range(-(10**3),10**3):
        if a**5-b**5==X:
            ans1=a
            ans2=b
            break
print(ans1,ans2)

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

Solution (Python):
X = int(input())
 
for i in range(-200, 200):
  for j in range(-200, 200):
    if i **5 - j**5 ==X:
      print(str(i)+' ' +str(j))
      exit()

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

Solution (Python):
import math

x = int(input())

fL = [i**5 for i in range(0, 1001)]

for i, f1 in enumerate(fL):
    for j, f2 in enumerate(fL):
        a = j
        b = i
        if f1 + f2 == x:
            print(a, -b)
            exit()
        if f1 - f2 == x:
            print(b, a)
            exit()

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

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

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

Solution (Python):
import math

x = int(input())
a = []
b = []
for i in range(-1000,1000,1):
    a.append([i,i**5])
    b.append([i,i**5])

for ai,a5 in a:
    for bi,b5 in b:
        if a5 - b5 == x:
            print(ai,bi)
            exit()

Solution (Python):
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H):
    '''
    H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) 
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_matrix(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    


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

from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  
from math import gcd

X = read_a_int()

candi = []
for i in range(10**10):
    if + (i + 1) ** 5 - i ** 5 > 10**11:
        break
    candi.append((i ** 5, i))
    candi.append((-i ** 5, -i))
candi.append((i ** 5, i))
candi.append((-i ** 5, -i))


for a5, a in candi:
    for b5, b in candi:
        if a5 - b5 == X:
            print(a, b)
            exit()

Solution (Python):
ma = lambda :map(int,input().split())
ni = lambda:int(input())
x = ni()
ma = 200
for i in range(ma):
    for j in range(-ma,ma):
        if (i**5 - j**5) ==x:
            print(i,j)
            exit()

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