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
input = sys.stdin.readline

def main():
    X = int(input())
    for A in range(-118, 120):
        for B in range(-118, 120):
            if A ** 5 - B ** 5 == X:
                print(A, B)
                sys.exit()

main()

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

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

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

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

Solution (Python):
X = int(input()) 
flag = 0
for j in range(-120, 120):
    if flag == 1:
        break
    for k in range(j+1, 120):
        if k**5 - j**5 == X:
            print(k,j)
            flag = 1
            break

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

Solution (Python):

def main():
    x = int(input())
    kouhodic = dict()
    for i in range(200):
        kouhodic[i ** 5] = i
        kouhodic[-i ** 5] = -i
    
    kouhodic = sorted(kouhodic.items())
    kazu = len(kouhodic)
    

    for i in range(kazu):
        for j in range(i+1, kazu):
            if kouhodic[j][0] - kouhodic[i][0] == x:
                print(kouhodic[j][1], kouhodic[i][1])
                exit()
    
    
    




if __name__ == "__main__":
    main()

Solution (Python):

import sys

input = sys.stdin.readline


def ST():
    return input().rstrip()


def I():
    return int(input())


def MI():
    return map(int, input().split())


def LI():
    return list(MI())


X = I()

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

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

break_flag = 0

for a in range(-200, 201):
    if break_flag == 1:
        break
    for b in range(-200, 201):
        if a**5 - b**5 == X:
            print(a, b)
            break_flag = 1
            break

Solution (Python):
import sys
import numpy as np
from math import ceil as C, floor as F, sqrt
from collections import defaultdict as D, Counter as CNT
from functools import reduce as R
 
ALP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
alp = 'abcdefghijklmnopqrstuvwxyz'
def _X(): return sys.stdin.readline().rstrip().split(' ')
def _S(ss): return tuple(ss) if len(ss) > 1 else ss[0]
def S(): return _S(_X())
def Ss(): return list(S())
def _I(ss): return tuple([int(s) for s in ss]) if isinstance(ss, tuple) else int(ss)
def I(): return _I(S())
def _Is(ss): return list(ss) if isinstance(ss, tuple) else [ss]
def Is(): return _Is(I())

x = I()

A = []
As = []
B = []
Bs = []

for i in range(250):
  n = i ** 5
  A.append(i)
  As.append(n)
  B.append(i)
  Bs.append(n)
  B.append(-i)
  Bs.append(-n)

xs = [a-x for a in As]
for i, x in enumerate(xs):
  if x in Bs:
    print(A[i], B[Bs.index(x)])
    break

Solution (Python):
from decimal import Decimal

x = int(input())
cnt = 0

while True:
    a = cnt ** 5
    if a < x:
        a = x - a
        z = -1
    else:
        a -= x
        z = 1

    a = Decimal(a) ** Decimal("0.2")
    if a % 1 == 0:
        print(cnt, int(a * z))
        break

    cnt += 1

Solution (Python):
from sys import stdin,stdout

n=int(stdin.readline())
for a in range(-400,400):
    for b in range(-400,400):
        if abs(a**5-b**5)==n:
            print(max(a,b),min(a,b))
            exit(0)

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())
def NIJIGEN(H): return [list(input()) for i in range(H)]
X=int(input())
L=list()
R=list()
for i in range(-1000,1001):
  L.append(i**5)
  R.append(i)
for i in range(-1000,1001):
  if (i**5)+X in L:
    n=L.index((i**5)+X)
    print(R[n],i)
    exit()

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

Solution (Python):
X=int(input())
A=[]
i,p=0,True
while p:
  a=i**5
  A.append(a)
  for b in A:
    if a-b==X:
      p=False
      print(i,A.index(b))
      break
    elif a+b==X:
      p=False
      print(i,-1*A.index(b))
      break
  i+=1

Solution (Python):
import math
from math import gcd
INF = float("inf")

import sys
input=sys.stdin.readline
sys.setrecursionlimit(500*500)
import itertools
from collections import Counter,deque

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

if __name__=="__main__":
    main()

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

@functools.lru_cache(maxsize=None)
def pow5(x):
    return x ** 5

@functools.lru_cache(maxsize=None)
def root5(x):
    i = 0
    while True:
        i5 = pow5(i)
        if x < i5:
            return None
        if i5 == x:
            return i
        i += 1

a = 0
while True:
    a5 = pow5(a)
    b = root5(a5 + X)
    if b is not None:
        print(-a, -b)
        break
    if a5 <= X:
        b = root5(X - a5)
        if b is not None:
            print(a, -b)
            break
    else:
        b = root5(a5 - X)
        if b is not None:
            print(a, b)
            break
    a += 1

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

Solution (Python):
import math

X = int(input())
absX = abs(X)
X = math.pow(X, 1/5)

X = math.floor(X)


Pow = []
Dif = []

for i in range(64):
    Pow.append(int(math.pow(i, 5)))


for i in range(1, 1000):
    Dif.append(i**5 - (i-1)**5)
    if ((i+1)**5 - i**5) > 1000000000:
        break





for n in range(len(Pow)):
    p = Pow[n]
    m = n
    while m < len(Pow):
        q = Pow[m]
        if p + q > absX:
            break
        
        if p + q == absX :
            
            if X < 0:
                print(-n, m)
            else:
                print(n, -m)
            exit(0)
        m += 1

for n in range(len(Dif)):
    sam = 0
    m = n
    while m < len(Dif):
        sam += Dif[m]
        if sam > absX:
            break
        
        if sam == absX:
            if X <= 0:
                print(n, m+1)
            else:
                print(-n,-(m+1))
            exit(0)
        m += 1

Solution (Python):
N=int(input())
L=[i**5 for i in range(150)]
for i in L:
    if N-i in L:
        if i-N>0:
            print(L.index(i),L.index(i-N))
        else:
            print(L.index(i),-1*L.index(N-i))
        break
    elif N+i in L:
        print(L.index(i+N),L.index(i))
        break

Solution (Python):
import sys

n = int(input())
for a in range(-200, 201):
    for b in range(-200, 201):
        if a * a * a * a * a - b * b * b * b * b == n:
            print(a, b)
            sys.exit(0)

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

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

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

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

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

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

Solution (Python):
X = int(input())
for a in range(1, 1000):
    a5 = a**5
    for b in range(-a+1, a):
        b5 = b**5
        if a5-b5 == X:
            print(a, b)
            exit()

Solution (Python):
import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

INF=10**20
def main():
    X=ii()

    def is_ok(a,b):
        return a**5 <= X+b**5

    for a in range(-1010,1010):
        l,r = -INF,INF
        while r-l > 1:
            mid = (r+l)//2
            if is_ok(a,mid):
                r = mid
            else:
                l = mid
        b=r
        
        if a**5-b**5==X:
            print(a,b)
            exit()




if __name__ == "__main__":
    main()

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

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

Solution (Python):
import sys
X = int(input())
for a in range(-200,200):
    for b in range(-200,200):
        if a ** 5 - b ** 5 == X:
            print(a,b)
            sys.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):
def solve():
    X = int(input())
    memo = {}
    for A in range(500):
        for B in range(500):
            memo[A**5-B**5] = (A,B)
            memo[A**5+B**5] = (A,-B)
    A,B = memo[X]
    print(A, B)

if __name__ == "__main__":
    solve()

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


if __name__ == '__main__':
    main()

Solution (Python):
X=int(input())
A_max=120
B_max=119
A_min=-119
B_min=-120
for i in range(-119,120):
	for j in range(-120,119):
		if i**5-j**5==X:
			print(i,j)
			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):
def resolve():
    X = int(input())

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

if __name__ == "__main__":
    resolve()

Solution (Python):
x=int(input())
A=[i**5 for i in range(-2000,2000)]
for i in range(4000):
    for j in range(i):
        if A[i]-A[j]==x:
            print(*[i-2000,j-2000]);exit()

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

min_x = -int(pow(x,0.2))-1
for a in range(x):
    for b in range(min_x,x):
        test = pow(a,5) - pow(b,5)
        if b > 0 and test < x:
            break
        if test == x:
            print(a,b)
            exit()

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

d =math.floor(math.pow(X, 1.0/4.0))
for i in range(-d-1,d+1,1):
    for j in range(-d-1,d+1,1):
        if X+j**5==i**5:
            print(i,j)
            exit()

Solution (Python):
ini = lambda : int(input())
inm = lambda : map(int,input().split())
inl = lambda : list(map(int,input().split()))
gcd = lambda x,y : gcd(y,x%y) if x%y else y
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])
    return arr
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 = ini()
for b in range(-121,121):
    for a in range(b,121):
        if (a ** 5) - (b ** 5) == x:
            break
    else:
        continue
    break
    
print(a,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):
x = int(input())
Pow = [1]
curr = 2
while True:
    if curr**5 - Pow[-1]**5 > x:
        break
    Pow.append(curr)
    curr += 1

mx = Pow[-1]
for i in range(mx + 1):
    Pow.append(-i)

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

Solution (Python):
x = int(input())
n = [i**5 for i in range(119+1)]

a = 0
b = 0
res = False
i = 0
while not res:
    sign = 1 - 2*(n[i] < x)
    for j in range(i+1):
        if (n[i] - n[j] * sign) == x:
            print(i,j*sign)
            res = True
    i += 1

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

p5 = []
m = 1000
for i in range(-m, m+1):
    p5.append(i**5)

for ci in range(2*m+1):
    if p5[ci] - x in p5:
        a = [ci-m, p5.index(p5[ci] - x)-m]
        break
a = [str(i) for i in a]
print(' '.join(a))

Solution (Python):
import math

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

    for a in range(-120,120):
        flag=0
        for b in range(-120,120):
            if pow(a,5)-pow(b,5)==X:
                print("{} {}".format(a,b))
                flag=1
                break
        if flag==1:
            break

if __name__=="__main__":
    main()

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(-500, 500):
  for j in range(-500, 500):
    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(-118,120):
        if X==A**5-B**5:
            print(A,B)
            exit()

Solution (Python):
cinq = [i ** 5 for i in range(300)]
X = int(input())
for a in cinq:
  if a + X in cinq:
    print(cinq.index(a+X), cinq.index(a))
    break
  elif X-a in cinq:
    print(cinq.index(a), -cinq.index(X-a))
    break

Solution (Python):
x = int(input())
count =0
for a in range(-200, 200):
    for b in range(-200, 200):
        if a**5 - b**5 == x:
            A = a
            B = b

print(A, B)

Solution (Python):
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
from itertools import product
def main():
    x = int(input())
    n5 = [i**5 for i in range(1000)]
    c = product(n5, repeat=2)
    for ce in c:
        if ce[0] + ce[1] == x:
            r = (int(ce[0]**0.2), int(ce[1]**0.2)* -1)
            break
        elif ce[0] - ce[1] == x:
            r = (int(ce[0] ** 0.2), int(ce[1] ** 0.2))
            break
    print(*r, sep=' ')
if __name__ == '__main__':
    main()

Solution (Python):
NUM=1000

X=int(input())

flg=False

for i in reversed(range(NUM)):
    for j in range(-1*NUM,NUM):
        res=(i**5)-(j**5)
        if res==X:
            ans_A=i
            ans_B=j
            flg=True
            break
    if flg:
        break

print(ans_A,ans_B)

Solution (Python):
x=int(input())
ans=[0,0]
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 os
import sys




def main():
    x = int(input())
    for a in range(-120, 120):
        for b in range(-120, a):
            if a**5-b**5 == x:
                print("{} {}".format(a, b))
                return


if __name__ == "__main__":
    main()

Solution (Python):
import sys
X=int(input())
for A in range(800):
    for B in range(-800,A+1):
        if X==A**5-B**5:
            print('{} {}'.format(A,B))
            sys.exit()

Solution (Python):

def main():
    import sys

    input = sys.stdin.readline

    X = int(input())

    for a in range(-150, 151):
        for b in range(-150, 151):
            if a ** 5 - b ** 5 == X:
                print(a, b, sep=' ')
                return


if __name__ == '__main__':
    main()

Solution (Python):

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

    if flag:
        break

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

C=[]
for i in range(10*100) :
    C.append(i**5)



for j in range(len(C)):
    for i in range(len(C)):
        if C[j]-C[i]==x :
            print( j, i )
            exit()
        elif C[j]+C[i]==x :
            print( j, 0-(i) )
            exit()

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

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


pow5 = {}
for i in range(-1000, 1001):
    pow5[i] = int(math.pow(i, 5))

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

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


def main():
    x = int(readline().rstrip())
    a, b, c = 0, 0, 1

    while a < 1000:
        k = a ** 5 - x
        c = 1 if k >= 0 else - 1
        b = abs(k) ** 0.2
        if int(b) ** 5 == abs(k):
            print(a, c * abs(int(b)))
            return
        a += 1


if __name__ == '__main__':
    main()

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 A in range(-200,200):
    for B in range(-200,200):
        if A**5-B**5==X:
            print(A,B)
            exit()

Solution (Python):

import collections as cl
import sys


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 main():
    N = II()

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


main()

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(str(a)+" "+str(b))

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

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

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

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

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

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

Solution (Python):
X = int(input())
A = []
for i in range(200):
    A.append(pow(i, 5))
for i in range(200):
    for j in range(200):
        a = abs(A[i] - A[j])
        b = A[i] + A[j]
        if a == X:
            if i <= j:
                B = [j, i]
            else:
                B = [i, j]
            print(' '.join(map(str, B)))
            exit()
        elif b == X:
            B = [i, -j]
            print(' '.join(map(str, B)))
            exit()

Solution (Python):
x=int(input())
a=0
b=0
for i in range(1000):
    for j in range(1000):
        if i**5-j**5==x:
            a=i
            b=j
            break
        elif i**5+j**5==x:
            a=i
            b=-j
            break
    if a!=0 or b!=0:
        break
print(str(a)+" "+str(b))

Solution (Python):
l=[]
for i in range(0,120):
    l.append(i**5)
n=int(input())
for i in range(0,120):
    if((l[i]-n) in l):
        print(i,l.index(l[i]-n))
        break
    elif((n-l[i]) in l):
        print(i,-l.index(-l[i]+n))
        break

Solution (Python):
l=[]
for i in range(0,1001):
    l.append(i**5)
n=int(input())
for i in range(0,1001):
    if((l[i]-n) in l):
        print(i,l.index(l[i]-n))
        break
    elif((n-l[i]) in l):
        print(i,-l.index(-l[i]+n))
        break

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

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

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

Solution (Python):
x = int(input())
x_3zyoukon=x**(1/3)
x_5zyoukon=x**(1/5)

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

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

Solution (Python):
X = int(input())
ans = ''
for i in range(-120, 120):
  for j in range(-120, 120):
    if i**5-j**5 == X:
      ans = i, j
      break
print(' '.join(map(str,ans)))

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

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

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

flag = False
for i in range(1000, -1, -1):
  
  for j in range(i, -1001, -1):
    
    if i - j != 0:
      if x % (i - j) == 0:
        y = x / (i - j)
        t = i ** 4 + (i ** 3) * j + (i ** 2) * (j ** 2) + i * (j ** 3) + j ** 4
        if y == t:
          lst = [str(i), str(j)]
          print(' '.join(lst))
          flag = True
          break
    else:
      if x == 0:
        print('0 0')
        flag = True
        break
  if flag:
    break

Solution (Python):
import sys

x = int(input())
for a in range(0,1000):
    a_5 = a**5
    if a_5 > x:
        b = 0
        s = x+1
        while s > x:
            s = a_5 - b**5
            if s == x:
                print(a, b)
                sys.exit()
            b += 1
            
    elif a_5 < x:
        b = 0
        s = x-1
        while s < x:
            s = a_5 - b**5
            if s == x:
                print(a, b)
                sys.exit()
            b -= 1
    else:
        print(a,0)
        sys.exit()

Solution (Python):
import sys

x = int(input())
for a in range(1,1000):
    a_5 = a**5
    if a_5 > x:
        b = 1
        s = x+1
        while s > x:
            s = a_5 - b**5
            if s == x:
                print(a, b)
                sys.exit()
            b += 1
            
    elif a_5 < x:
        b = -1
        s = x-1
        while s < x:
            s = a_5 - b**5
            if s == x:
                print(a, b)
                sys.exit()
            b -= 1
    else:
        print(a,0)
        sys.exit()

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

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

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


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

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


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

Solution (Python):
import sys
x = int(input())
box = [a**5 for a in range(0,200)]
for i in range(200):
    for j in range(200):
        if box[i] - box[j] == x:
            print(i,j)
            sys.exit()
for k in range(200):
    for l in range(200):
        if (-1)*box[k] + box[l] == x:
            print(-(k),-(l))
            sys.exit()
for s in range(200):
    for t in range(200):
        if box[s] + box[t] == x:
            print(s,-(t))
            sys.exit()

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

Solution (Python):

X = int(input())
flag = 0
for i in range(-150,150):
  for j in range(-150,150):
    if(i**5 - j**5 == X):
      print(i,j)
      flag = 1
      break
  if(flag==1):
    break

Solution (Python):
import collections


def main():
    X = int(input())
    A, B = 0, 0
    for i in range(-120, 120):
        if A == 0 and B == 0:
            for j in range(-120, 120):
                if i ** 5 - j ** 5 == X:
                    A, B = i, j
                    break
        else:
            break

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


if __name__ == "__main__":
    main()

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

Solution (Python):
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

x = k()
for i in range(-int(x**(1/4))+1,int(x**(1/4))+1):
    for j in range(-int(x**(1/4))+1,int(x**(1/4))+1):
        if i**5 - j**5==x:
            print("{} {}".format(i,j))
            sys.exit()

Solution (Python):
from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque

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

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

Solution (Python):

X = int(input())

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

for b, b_5 in enumerate(l, start=-300):
    
    if X+b_5 in l:
        a_5 = X+b_5
        a = l.index(a_5)-300
        print(a, b)
        break

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

for a in range(-140,140):
  for b in range(-140,140):
    if (a**5-b**5)==x:
      c=a
      d=b
      break
      
print(str(c)+' '+str(d))

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

ans=''
for a in range(-125,125):
    for b in range(-125,125):
        i = a**5-b**5
        if i == X:
            ans=[a,b]
print(' '.join(map(str,ans)))

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


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

Solution (Python):

import sys

x = int(input())

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

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

ans = False
for a in range(-10**3,10**3):
    for b in range(-10**3,10**3):
        if a**5 - b**5 == x:
            print(a,b)
            ans = True
            break
    if ans:
        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())
l = [i**5 for i in range(10000)]
for idx, a in enumerate(l):
    b = a - x
    if b in l:
        print(idx, l.index(b))
        exit()
    elif -b in l:
        print(idx, -l.index(abs(b)))
        exit()

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

if __name__ == "__main__":
    main()

Solution (Python):
import numpy as np


def main():
    x = int(input())
    A = np.arange(-120, 120)
    a = A ** 5
    for i, a_1 in enumerate(a):
        for j, a_2 in enumerate(a):
            if a_1 - a_2 == x:
                print(A[i], A[j])
                return


if __name__ == "__main__":
    main()

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):
n=int(input())
a=False
for i in range(200):
  for j in range(200):
    if i**5-j**5==n:
      print(i,j)
      a=True
    elif i**5+j**5==n:
      print(i,-j)
      a=True
  if a:
      break

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

X_range = int(pow(X, 1/4))+1

for i in range(X_range, -X_range-1, -1):
    for j in range(-X_range, X_range+1):
        if pow(i, 5) - pow(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, bisect, math, itertools, string, queue, copy
import numpy as np
import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
from fractions import gcd
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

x = inp()
dp = []
for i in range(5000):
    dp.append(i**5)

for i in range(5000):
    if (x - dp[i]) in dp:
        print(i,-1 * dp.index((x - dp[i])))
        exit()
    if (dp[i] - x) in dp:
        print(i,dp.index((dp[i] - x)))
        exit()

Solution (Python):
x = int(input())
y = 10**4

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