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

for i in range(-2*int(abs(x**0.2)),2*int(abs(x**0.2))+1):
    for j in range(-2*int(abs(x**0.2)), 2*int(abs(x**0.2))+1):
        if i**5-j**5==x:
            print(f"{i} {j}")
            bf=1
            break
    if bf==1:
        break

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

def solve():

    X = int(input().rstrip())

    for A in range(1000):
        A5 = A*A*A*A*A
        for B in range(-1000,1000):
            B5 = B*B*B*B*B
            if A5-B5 == X:
                print(f'{A} {B}')
                return

solve()

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

x = int(readline())
for a in range(-500, 500):
    for b in range(-500, 500):
        if pow(a, 5) == x + pow(b, 5):
            print(a, b)
            exit()

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

pow_li = [pow(i,5) for i in range(1000)]

for i in range(1000):
    for j in range(1000):
        if pow_li[i]-pow_li[j]==x:
            print(i,j);exit()
        elif pow_li[i]+pow_li[j]==x:
            print(i,-j);exit()

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



N = [i**5 for i in range(10000)]
 


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




		if N[j] - N[i] == X:
			print(j, i)
			exit()



		if N[j] + N[i] == X:
			print(j, -i)
			exit()

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

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

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



N = [i**5 for i in range(1000)]
 


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




		if N[j] - N[i] == X:
			print(j, i)
			exit()



		if N[j] + N[i] == X:
			print(j, -i)
			exit()

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



N = [i**5 for i in range(1000)]
 



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




		if N[j] - N[i] == X:
			print(j, i)
			exit()



		if N[j] + N[i] == X:
			print(j, -i)
			exit()

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



N = [i**5 for i in range(1000)]
 



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




		if N[j] - N[i] == X:
			print(j, i)
			exit()



		if N[j] + N[i] == X:
			print(j, -i)
			exit()

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





def main():
    X = int(input().strip())
    for A in range(-119, 120):
        for B in range(-119, 120):
            if A ** 5 - B ** 5 == X:
                return "{} {}".format(A, B)

    else:
        return "Invalid X"


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

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

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



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




for i in range(0,int(x**(1/4)+1)):
    for j in range(-int(x**(1/4))-2,0):
        if i**5 - j**5 == x:
            print(i,j)
            sys.exit()

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

for a in range(0,200):
  a5 = a**5
  b5 = a5 - x
  if b5 >= 0:
    b = int( float(b5)**0.2 )
    if b**5 == b5:
      print(a,b)
      break
  else:
    b5 = -b5
    b = int( float(b5)**0.2 )
    if b**5 == b5:
      print(a,-b)
      break

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

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

Solution (Python):
import sys
from collections import deque
import copy
def main():
    X = int(input())
    now = 1
    for A in range(-118, 120):
        for B in range(-119, 118):
            if A ** 5 - B ** 5 == X:
                print(A, B)
                sys.exit()


if __name__ == '__main__':
    main()

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

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

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

for i in range(-120,120):
    for j in range(-120,120):
        res = i**5 - j**5
        if(res == x):
            flag = 1
            break
    if(flag == 1):
        break

print(i,j)

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

Solution (Python):
if __name__ == '__main__':
    x = input()
    x = int(x)

    flag = False
    a = 0
    b = 0
    for i in range(1,120):
        for j in range(1,120):
            ab = i**5 - (i-j)**5
            if ab == x:
                flag = True
                a = i
                b = i-j
                break
        if flag:
            break

    print(a,b)

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

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

Solution (Python):
def solve(string):
    x = int(string)
    a = {i**5: i for i in range(-120, 121)}
    for i in range(-121, 121):
        if x + i ** 5 in a:
            return str(f"{a[x+i**5]} {i}")


if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))

Solution (Python):
x = int(input())
a, b = 0,0
done = False
for i in range(-2000, 2000):
    for l in range(2000,-2000, -1):
        if((i**5)-(l**5)==x):
            a = i
            b = l
            print(a,b)
            done  = True
            break
    if(done):
        break

Solution (Python):
def solve(string):
    x = int(string)
    a = {i**5: i for i in range(-10000, 10000)}
    for i in range(-10000, 10000):
        if x + i ** 5 in a:
            return str(f"{a[x+i**5]} {i}")


if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))

Solution (Python):
import sys

x = int(input())
for a in range(-150, 150):
    for b in range(-150, a):
        if a**5 - b**5 == x:
            print(*[a, b])
            sys.exit()

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

for i in range(290):
        n=x+(i-145)**5
        for j in range(290):
            if (j-145)**5==n:
                print(j-145,i-145)
                exit()

Solution (Python):
import sys
x = int(input())
l = range(201)
for i in l:
  for j in l:
    if i**5+j**5 == x:
      print(' '.join([str(i),str(-j)]))
      sys.exit()
    elif i**5-j**5 == x:
      print(' '.join([str(i),str(j)]))
      sys.exit()
    else:
      pass

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

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

Solution (Python):
def main():
    x = int(input())
    a = 1
    diff = 1
    while True:
        res = a ** 5 - (a - diff) ** 5
        if res < x:
            a += 1
            continue
        if res == x:
            print(a, a - diff)
            break
        while True:
            diff += 1
            if x % diff == 0:
                break
        a = (diff + 1) // 2

if __name__ == '__main__':
    main()

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


if __name__ == '__main__':
    main()

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

a = 1
diff = 1
while True:
    res = a ** 5 - (a - diff) ** 5
    if res == x:
        print(a, a - diff)
        break
    if res < x:
        a += 1
        continue
    while True:
        diff += 1
        if x % diff == 0:
            break
    a = (diff + 1) // 2

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


if __name__ == '__main__':
    main()

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


if __name__ == '__main__':
    main()

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

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

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)
            break
    else:
        continue
    break

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

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

def myfunc(X):
  for a in range(-120,120):
    for b in range(-120,120):
      if a**5-b**5 == X:
        return a,b
      
a, b = myfunc(X)

print(a,b)

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

Solution (Python):
X = int(input())
for a in range(-500, 501, 1):
    for b in range(-500, 501, 1):
        if a**5 - b**5 == X:
            print(a, b)
            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)
            break
    else:
        continue
    break

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

for xi in range(-150,150):
    for yi in range(-150,150):
        if (xi**5 - yi**5)==X:
            print(xi,yi)
            sys.exit()

Solution (Python):
x=int(input())
m=list()
n=list()
for i in range(200):
    m.append(i**5)
    n.append(-i**5)
    if (x+(i**5)) in m:
        a=m.index(x+(i**5))
        b=i
        break
    if (x-i**5) in m:
        a=m.index(x-(i**5))
        b=-i
        break
    if (x-(i**5)) in n:
        a=i
        b=n.index(x-i**5)
        break    
print(a," ",b)

Solution (Python):
from collections import Counter

X = int(input())

l = [0]
i = 0
while i**5 - (i-1)**5 <= X:
    i+=1
    l.append(i**5)

for i in l:
    if Counter(l)[X - i]==1:
        print(l.index((X-i)), -l.index(i))
        quit()
    if Counter(l)[X + i]==1:
        print(l.index(X+i), l.index(i))

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)
            break
    else:
        continue
    break

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

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

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

Solution (Python):

X=int(input())
for i in range(1000):
    for a in range(1000):
        if a**5-(a-i)**5==X:
            print(a,a-i)
            break

Solution (Python):
x = int(input())
flag = 0
for a in range(-200, 201):
    if flag == 1:
        break
    for b in range(-200, 201):
        if a**5 - b**5 == x:
            print(a, b)
            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):
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())

flag = True

for a in range(1, 1000):
    a5 = pow(a, 5)
    for b in range(-1000, 1000):
        b5 = pow(b, 5)
        if a5 - b5 == x and flag:
            print(a, b)
            flag = False

Solution (Python):
x = int(input())
a = 0
while True:
    po = pow(a, 5)
    b = po - x
    c = x - po
    if b > 0:
        ans = int(pow(b, 0.2))
    else:
        ans = - int(c ** 0.2)
    ans_p = pow(ans, 5)
    if ans_p == b or ans_p == c: 
        print(a, ans)
        break
    else:
        a += 1

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

for a in range(-120, 120):
  f_a = a**5
  d = f_a-x
  b = round(abs(d)**(1/5).real)
  if d<0: b *= -1
  if f_a - b**5 == x:
    print(a, b)
    break

Solution (Python):
x = int(input())
l = []
for i in range(130):
    l.append(i ** 5)
for i in l:
    a = int(i ** 0.2)
    b = i - x
    c = x - i
    if b in l or c in l:
        if b > 0:
            ans = int(b ** 0.2)
        else:
            ans = - int(c ** 0.2)
        print(a, ans)
        break
else:
    print("NO")

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

for a in range(-120, 120):
  f_a = a**5
  r_b = (x-f_a)**(1/5).real
  b = round(r_b.real)
  if f_a - b**5 == x:
    print(a, b)
    break

  b *= -1
  if f_a - b**5 == x:
    print(a, b)
    break

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

for a in range(-120, 120):
  f_a = a**5
  r_b = (x-f_a)**(1/5).real
  b = round(r_b.real)
  if f_a - b**5 == x:
    print(a, b)
    break
  b *= -1
  if f_a - b**5 == x:
    print(a, b)
    break

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

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

    break

Solution (Python):
x = int(input())
ans = []
for i in range(10000):
	b = i**5 - x
	if b <0:
		B = -b
		s = int(pow(B,0.2))
		if s**5 == B:
			ans = [i, -s]
			break
	else:
		s = int(pow(b,0.2))
		if s**5 == b:
			ans = [i, s]
			break
print(ans[0], ans[1])

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

result = [0, 0]
powers = [x**5 for x in range(1001)]

end_flag = False
for i in range(1001):
    a5 = powers[i]
    for j in range(i, 1001):
        b5 = powers[j]
        x = a5 - b5
        if (x == X):
            result[0] = i
            result[1] = j
            end_flag = True
            break
        elif (-x == X):
            result[0] = -i
            result[1] = -j
            end_flag = True
            break
        x = a5 + b5
        if (x == X):
            result[0] = i
            result[1] = -j
            end_flag = True
            break
        elif (-x == X):
            result[0] = -i
            result[1] = j
            end_flag = True
            break
    if end_flag:
        break

A, B = result
print(f"{A} {B}")

Solution (Python):














x = int(input())

for a in range(-120,121):
    for b in range(-121,120):
        if a**5 - b**5 == x:
            print(f"{a} {b}")
            exit()

Solution (Python):
X = int(input())
flag = False
for a in range(-118, 120):
    for b in range(-119, 119):
        if a**5 - b**5 == X:
            print('{} {}'.format(a,b))
            flag = True
            break
    if flag:
        break

Solution (Python):
import sys

x = int(input())

for i in range(-200, 200):
    for j in range(-200, 200):
        if i ** 5 - j ** 5 == x:
            print('{} {}'.format(i, j))
            sys.exit()

Solution (Python):
import sys

X = int(input())

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

Solution (Python):
def func(x):
    for A in range(-118,120):
        for B in range(-119,119):
            if (A**5-B**5)==x:
                return A,B

def main():
    x=int(input())
    print("%d %d" %func(x))
                

if __name__=="__main__":
    main()

Solution (Python):



def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**6)
    

    def dump(*args):
        sys.stderr.write(str(args))

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


if __name__ == '__main__':
    main()

Solution (Python):
M = 0
i = 1
while i ** 5 - (i-1) ** 5 <= 10**9:
    i += 1
M = i

X = int(input())
for B in range(-M, M + 1):
    for A in range(B + 1, M + 1):
        if A**5 - B**5 == X:
            print(A, B)
            break
    else:
        continue
    break

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

xr = int(x ** 0.2)
m = 0
for i in reversed(range(xr + 1)):
    for j in range(m,i):
        ip = i ** 5
        jp = j ** 5
        sumij = ip + jp
        if sumij < x:
            m = j
        elif sumij > x:
            break
        else:
            print(str(i) + " " + str(-1 * j))


m = 0
for i in range(xr + 1,1000):
    for j in range(m,i):
        ip = i ** 5
        jp = j ** 5
        subij = ip - jp
        if subij > x:
            m = j
        elif subij < x:
            break
        else:
            print(str(i) + " " + str(j))

Solution (Python):
import sys
l = sys.stdin.readline().strip()
x = int(l)
cands = []
for i in range(-121, 121):
    cands.append(i**5)
for i, one in enumerate(cands):
    for j, two in enumerate(cands):
        if one - two == x:
            print(i-121,j-121)
            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:
            pass
        else:
            print(i,j)
            exit()

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

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

Solution (Python):


def main():
    answer = int( input() )
    a, b = 0, 0

    while True:
        if a ** 5 - b ** 5 == answer:
            break
        if a ** 5 > answer + ( b ** 5 ):
            a -= 1
        if a ** 5 < answer + ( b ** 5 ):
            a += 1
        if b ** 5 > ( a ** 5 ) - answer:
            b -= 1
        if b ** 5 < ( a ** 5 ) - answer:
            b += 1

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

if __name__ == "__main__":
    main()

Solution (Python):
def f(x):
 return x*x*x*x*x

n=int(input())

for i in range(-500,500):
 for j in range(-500,500):
  if f(i)-f(j)==n:
   print(i,j)
   exit()

Solution (Python):




X = int(input())

def main():
    for a in range(-200, 200):
        for b in range(-200, 200):
            if X == a**5 - b**5:
                print(f"{a} {b}")
                return

main()

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

def main():
  X = int(readline().strip())
  ret = False
  for i in range(-120, 120):
    for j in range(-120, 120):
      if i**5-j**5 == X:
        ret = True
        print(i, j)
        break
    if ret:
      break

if __name__ == '__main__':
  main()

Solution (Python):
from sys import stdin, stdout
import math
import bisect
import re

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

for a in range(-500, 500):
    for b in range(-500, 500):
        if a ** 5 - b ** 5 == x:
            stdout.writelines(str(a) + ' ' + str(b) + '\n')
            exit(0)

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

Solution (Python):
n=int(input())
for i in range(-1000,1000):
	for j in range(-1000,1000):
		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):
        l=i**5-j**5
        if l==n:
            print(i,j)
            break
    if l==n:
        break

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

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

Solution (Python):
s=int(input())
flag=0
for n in range(-118,119):
    if flag==1:
        break
    for m in range(-119,118):
        if n**5-m**5==s:
            flag=1
            print(n,m)
        if flag==1:
            break

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

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

a = b = -1
con = True
while con:
  a += 1
  b5 = a**5 - x
  b1 = int(abs(b5**0.2))
  if b1**5 == b5:
    b = b1 
    con = False
  elif b1**5 == -1*b5:
    b = -1*b1
    con = False
print(str(a)+' '+str(b))

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


'''
A=[]
B=[]
for i in range():
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)'''
cnt=0
x=int(input())
sgn=[[1,1],[-1,-1],[-1,1],[1,-1]]
for i in range(0,201):
    for j in range(0,201):
        for k in range(4):
            if sgn[k][0]*i**5-sgn[k][1]*j**5==x:
                print(sgn[k][0]*i, sgn[k][1]*j)
                sys.exit()

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


if __name__ == '__main__':
    main()

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

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

Solution (Python):
def main():
    p5 = [k**5 for k in range(120)]
    X = int(input())
    for a in range(119, 0, -1):
        bend = max(-54, -a)
        for b in range(a - 1, bend - 1, -1):
            if b >= 0:
                if p5[a] - p5[b] == X:
                    return a, b
            else:
                if p5[a] + p5[-b] == X:
                    return a, b


print(*main())

Solution (Python):
import sys
x = int(input())
if x ==0:
    print(1, 1)
    sys.exit()
    
div = []
for i in range(1, round(x**0.5)+1):
    if x % i ==0:
        div.append(i)
        if i != x/i:
            div.append(x//i)

for d in div:
    minvalue = -d//2
    maxvalue = 1000
    while maxvalue - minvalue > 1:
        midvalue = (minvalue + maxvalue)//2
        if (midvalue+d)**5 - midvalue**5 < x:
            minvalue = midvalue
        else:
            maxvalue = midvalue
            
        if (maxvalue+d)**5 - maxvalue**5 == x:
            break
    else:
        continue
    break
    
print(d+maxvalue, maxvalue)

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

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

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

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

Solution (Python):
x = int(input())
L = dict()
U = 10**4
for i, b in enumerate(range(-U, U+1), -U):
    L[b**5] = i
for b in range(-U, U+1):
    if b**5 + x in L:
        print(L[b**5 + x], b)
        exit()

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

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

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

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

x = int(input())
lb, rb = -119, 119
for a in range(lb, rb + 1):
	for b in range(lb, rb + 1):
		if pow(a, 5) - pow(b, 5) == x:
			exit(print(a, b))

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

x = int(input())
lb, rb = -500, 500
for a in range(lb, rb + 1):
	for b in range(lb, rb + 1):
		if pow(a, 5) - pow(b, 5) == x:
			exit(print(a, b))

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

Solution (Python):
n = int(raw_input())
import sys
for i in xrange(350):
    for j in xrange(i):
        a = i - 175;
        b = j - 175
        if (a**5 - b**5) == n:
            print "{} {}".format(a, b)
            sys.exit(0)

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

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

Solution (Python):
X = int(input())
ans = 0
for i in range(1000):
  for j in range(1000):
    if i**5 - j**5 == X:
      ans += 1
      A = i
      B = j
    if i**5 - (-j)**5 == X:
      ans += 1
      A = i
      B = -j
    if (-i)**5 - j**5 == X:
      ans += 1
      A = -i
      B = j
    if (-j)**5 - j**5 == X:
      ans += 1
      A = -i
      B = -j

print(str(A)+" "+str(B))

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

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

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

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

for a in range(-1000, 1000, 1):
  for b in range(-1000, 1000, 1):
    if (a ** 5) - (b ** 5) == X:
      print('{} {}'.format(a, b))
      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().strip())

A = 1
B = -1
found = False
while (True):
    A5 = A ** 5
    B = -A
    while (True):
        if (B >= A):
            break
        if (X == A5 - B ** 5):
            found = True
            break
        B += 1
    if (found):
        break
    A += 1
    if (A > X):
        break

print(A,' ',B)

Solution (Python):
X = int(input())
for A in range(130):
  for B in range(130):
    if (A**5) - (B**5) == X:
      print("{} {}".format(A,B))
      exit()
    elif ((-1*A)**5) - (B**5) == X:
      print("{} {}".format(-1*A,B))
      exit()
    elif (A**5) - ((-1*B)**5) == X:
      print("{} {}".format(A,-1*B))
      exit()   
    elif ((-1*A)**5) - ((-1*B)**5) == X:
      print("{} {}".format(-1*A,-1*B))
      exit()

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

x = int(input())

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

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

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

for a in range(-120,120):
    for b in range(-120,120):
        if a**5 - b**5 == X:
            ans_a,ans_b = a,b
            break


print(ans_a,ans_b)

Solution (Python):
"""
~~ author : dokueki
~~ created : 10~05~2020
"""

import sys
INT_MAX = sys.maxsize
INT_MIN = -(sys.maxsize)-1
sys.setrecursionlimit(10**7)
mod = 1000000007


def IOE():
    sys.stdin = open("input.txt", "r")
    sys.stdout = open("output.txt", "w")


def main():
    n = int(sys.stdin.readline())
    ans = []
    for i in range(-118, 120):
        for j in range(-119, 119):
            if i ** 5 - j ** 5 == n:
                ans.append([i, j])

                break
    print(*ans[0])


if __name__ == "__main__":
    try:
        IOE()
    except:
        pass
    main()

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

Solution (Python):



X = int(input())


ans_list = [0, 0]


for a in range(-500, 501):
    for b in range(-500, 501):
        if a**5-b**5==X:
            ans_list[0] = a
            ans_list[1] = b
            break


print(" ".join(map(str, ans_list)))

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


if __name__ == '__main__':
    main()

Solution (Python):
X = int(input())
flag = 1
a = -1000
b = -1000
for i in range(-1000, 1000):
  for j in range(-1000, 1000):
    if i**5-j**5 ==X:
      a = i
      b = j
print(f"{a} {b}")

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

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

Solution (Python):
X = int(input())
Num = 1
Check = "NG"

while Check == "NG":
    A_list = [i for i in range(Num)]
    B_list = [i for i in range(Num)]
    for i in range(Num):
        for j in range(Num):
            A5 = A_list[i] ** 5
            B5 = B_list[j] ** 5
            if A5 + B5 == X or A5 - B5 == X or -A5 + B5 == X:
                Check = "OK"
                break
        if Check == "OK":
            break
    if Check == "OK":
        break
    Num += 1
if A5 + B5 == X:
    print("{} -{}".format(i, j))
elif A5 - B5 == X:
    print("{} {}".format(i, j))
elif -A5 + B5 == X:
    print("-{} -{}".format(i, j))