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 a in range(-500, 501):
    for b in range(-500, 501):
        if a**5 - b**5 == x:
            print(a, b)
            exit()
print(3 / 0)

Solution (Python):

import sys

def solve(X: int):

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



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  
    solve(X)

if __name__ == '__main__':
    main()

Solution (Python):
'''
x = 0
while (x+1)**5 - x**5 < 1000000000:
    x += 1
print(x)
'''
maximum = 120
minimum = -120

x = int(input())

for i in range(minimum+1, maximum):
    for j in range(minimum, maximum-1):
        if i**5 - j**5 == x:
            a = i
            b = j

print(a, b)

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

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

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

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

Solution (Python):
a=[i**5 for i in range(100001)]
b=[i**5 for i in range(50001)]
x=int(input())
k=0
for i in a:
  for j in b:
    if i - j == x:
      k = 1
      print(a.index(i),b.index(j))
      break
    if i + j ==x:
      k=1
      print(a.index(i),-b.index(j))
  if k==1:
    break

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):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
import bisect
import numpy as np
import math
from collections import deque
from collections import defaultdict
from math import gcd

X = int(input())

maxi = 125
mini = -125

for a in range(mini, maxi):
    for b in range(mini, maxi):
        if a**5 - b**5 == X:
            print("{} {}".format(a, b))
            sys.exit()

Solution (Python):
def pow_kai(a, n):
    x = 1
    while(n > 0):
        if(n&1):
            x = x*a
        a = a*a
        n >>= 1
    return x


def main():
    X = int(input())
    pow5 = []

    for i in range(0,10**9):
        pow5.append(pow_kai(i,5))
        for k in range(0, i+1):
            if pow5[i]-X == pow5[k]:
                print(i, k)
                return
            elif pow5[i]-X == -pow5[k]:
                print(i, -k)
                return

if __name__ == '__main__':
    main()

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

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(str(a)+' '+str(b))
            sys.exit(0)

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

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

m = math.ceil((x / 2) ** (1 / 5))
M = int(x ** (1 / 5))
for i in range(m, M + 1):
    n = int((x - i ** 5) ** (1 / 5))
    if n ** 5 == x - i ** 5:
        print(str(int(i)) + ' ' + str(int(-n)))
        break

l = M
L = math.ceil((x / 5) ** (1 / 4) + 1)
for i in range(l + 1, L):
    n = int((i ** 5 - x) ** (1 / 5))
    if n ** 5 == i ** 5 - x:
        print(str(int(i)) + ' ' + str(int(n)))
        break

Solution (Python):
x = int(input())
a = [pow(i, 5) for i in range(-121, 122)]
flag = 0
for i in range(len(a)):
    for j in range(i+1, len(a)):
        if a[i] - a[j] == x:
            print(i-121, j-121)
            flag = 1
            break
        elif a[j] - a[i] == x:
            print(j-121, i-121)
            flag = 1
            break
    if flag == 1:
        break

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

Solution (Python):
import sys
def input():
    return sys.stdin.readline()[:-1]


def main():
    X = int(input())
    l = [i ** 5 for i in range(120)]
    for i in l:
        for j in l:
            if i + j == X:
                print(int(i ** (1 / 5)), int(-1 * j ** (1 / 5)))
                break
            elif i - j == X:
                print(int(i ** (1 / 5)), int(j ** (1 / 5)))
        else:
            continue
        break


if __name__ == "__main__":
    main()

Solution (Python):
x = int(input())
for a in range(120):
    for b in range(-120, a):
        if pow(a,5)-pow(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("{} {}".format(A, B))
            break
    else:
        continue
    break

Solution (Python):
from sys import stdin

def ans():
    _in = [_.rstrip() for _ in stdin.readlines()]
    X = int(_in[0])  
    
    for A in range(-118,120):
        for B in range(-119,A):
            if A**5-B**5 == X:
                break
        else:
            continue
        break
    
    print(A, B)


if __name__ == "__main__":
    
    ans()

Solution (Python):


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

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


if __name__ == "__main__":
    submit()

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

    a = -1
    
    while True:
        b1 = 0
        b2 = 0
        while b1 < a:
            
            if (X/(a-b1)).is_integer():
                if int(X/(a-b1)) == a**4 + b1*(a**3) + (a**2)*(b1**2) + a*(b1**3) + b1**4:
                    print("{} {}\n".format(a, b1))
                    return 0

            if (X/(a-b2)).is_integer():
                if int(X/(a-b2)) == a**4 + b2*(a**3) + (a**2)*(b2**2) + a*(b2**3) + b2**4:
                    print("{} {}\n".format(a, b2))
                    return 0

            b1 += 1
            b2 -= 1
            
        a += 1


if __name__ == "__main__":
    main()

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

x = int(input())
divisors = []
i = 1
while i*i<=x:
    if x%i == 0:
        divisors.append(i)
        divisors.append(round(x/i))
    i+=1
for d in divisors:
    if fip(d)-fip(0) == x:
        print(d,0)
        break
    end = 1
    while fip(end)-fip(end-d)<=x:
        end*=2
    start = round(end/2)
    if end == 1:
        if fip(1)-fip(1-d) == x:
            print(1,1-d)
            break
    elif fip(end)-fip(end-d)==x:
        print(end,end-d)
        break
    answer = -1
    found = False
    while(start<=end and not found):
        mid = (start+end)//2
        if fip(mid)-fip(mid-d) == x:
            answer = mid
            found = True
        else:
            if fip(mid)-fip(mid-d)>x:
                end = mid-1
            else:
                start = mid+1
    if answer!=-1:
        print(answer,answer-d)
        break
    start = 0
    end = round((x/2)**(1/5))
    found = False
    while(start<=end and not found and start<=d):
        if fip(start)+fip(d-start) == x:
            answer = start
            found = True
        start+=1
    if found == True:
        print(answer,answer-d)
        break

Solution (Python):
def ABC166D(x):
    for a in range(-118, 120):
        for b in range(-119, 119):
            if a**5 - b**5 == x:
                print(a, b)
                return

x = int(input())
ABC166D(x)

Solution (Python):
x=int(input())
j=0
while True:
  j+=1
  for i in range(j+1):
    a=j
    b=j-i
    if pow(a,5)-pow(b,5)==x:
      print(a,b)
      exit(0)
    b*=-1
    if pow(a,5)-pow(b,5)==x:
      print(a,b)
      exit(0)
    b*=-1
    a*=-1
    if pow(a,5)-pow(b,5)==x:
      print(a,b)
      exit(0)

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

Solution (Python):
X = int(input())
for i in range(121):
  for j in range(250):
    if i**5 - (120 -j)**5 == X:
      a = i
      b = 120 - j
print(str(a) + ' ' + str(b))

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

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

    if flag:
        break

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

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

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

A=0
B=0

while True:
    A=0
    while A**5<=X+B**5:
        if A**5==X+B**5:
            print(A,B)
            exit()
        elif A**5==X-B**5:
            print(A,-1*B)
            exit()
        A+=1
    B+=1

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

Solution (Python):
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
x = int(input())
a = 0
b = 0
comp = 0
while comp == 0 :
    aa = a**5
    tmp = aa - x
    if tmp < 0:
        b = -(pow(-tmp,1/5))
    elif tmp == 0:
        b = 0
    else:
        b = pow(tmp,1/5)
    b = Decimal(str(b)).quantize(Decimal('0.00000001'), rounding=ROUND_HALF_UP)
    b = float(b)
    if b.is_integer():
        b = int(b)
        comp = 1
    elif a <= 0:
        a = abs(a)+1
    else:
        a = -a
print(a,b)

Solution (Python):
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
x = int(input())

a = 0
b = 0
comp = 0

while comp == 0 :
    aa = a**5
    tmp = aa - x
    if tmp < 0:
        b = -(pow(-tmp,1/5))
        b = Decimal(str(b)).quantize(Decimal('0.00000001'), rounding=ROUND_HALF_UP)
    elif tmp == 0:
        b = 0
    else:
        b = pow(tmp,1/5)
        b = Decimal(str(b)).quantize(Decimal('0.00000001'), rounding=ROUND_HALF_UP)
    b = float(b)
    if b.is_integer():
        b = int(b)
        comp = 1
    else:
        aa = (-a)**5
        tmp = aa - x
        if tmp < 0:
            b = -(pow(-tmp,1/5))
            b = Decimal(str(b)).quantize(Decimal('0.00000001'), rounding=ROUND_HALF_UP)
        elif tmp == 0:
            b = 0
        else:
            b = pow(tmp,1/5)
            b = Decimal(str(b)).quantize(Decimal('0.00000001'), rounding=ROUND_HALF_UP)
        b = float(b)
        if b.is_integer():
            b = int(b)
            a = -a
            comp = 1
        else:
            a += 1
print(a,b)

Solution (Python):
X=int(input())
l=[]
for i in range(300):
    a=i**5
    l.append(a)
    l.append(-a)
for j in l:
    for s in l:
        if j-s==X and j!=s:
            ans=[]
            for i in [j,s]:
                aaa=abs(i)**(1/5)
                if i>=0:
                    ans.append(int(aaa))
                else:
                    ans.append(int(-aaa))
            print(*ans)
            exit()

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

    flag=0
    for A in range(-118,120):
        for B in range(-119,119):
            if pow(A,5)-pow(B,5)==X:
                print("{} {}".format(A,B))
                flag=1
        if flag==1:
            break
if __name__=="__main__":
    main()

Solution (Python):

from itertools import permutations

def power(base, exp):
  """ Fast power calculation using repeated squaring """
  if exp < 0:
      return 1 / power(base, -exp)
  ans = 1
  while exp:
      if exp & 1:
          ans *= base
      exp >>= 1
      base *= base
  return ans

def parse():
  return int(input())

def main():
  X = parse()

  A = None
  B = None

  
  
  
  
  

  max_val = 1000
  signs = [[1, 1], [-1, 1], [1, -1], [-1, -1]]

  for i in range(0, max_val + 1):
    for j in range(0, max_val + 1):
      for sign in signs:
        
        
        if power(i * sign[0], 5) - power(j * sign[1], 5) == X:
          A = i * sign[0]
          B = j * sign[1]
          print(A, B)
          exit(0)
  print(0, 0)

if __name__ == "__main__":
  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)
            exit()

Solution (Python):
x = int(input())
a = 0
if x == 0:
    print(0, 0)
else:
    while a ** 5 - (a - 1) ** 5 <= x:
        a += 1
        b = a
        while a ** 5 - b ** 5 < x:
            b -= 1
            if a ** 5 - b ** 5 == x:
                break
        else:
            continue
        break
    print(a, b)

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

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


def main():
    x, = map(int, open(0).read().split())

    """
    x=a^5-b^5=(a-b)(a^4+a^3b+a^2b^2+ab^3+b^4)
    x//(a-b)=int>0
    a-b>0
    x=O(a^4)
    """

    for i in range(-1000, 1000 + 1):
        for j in range(-i + 1, i):
            if i**5 - j**5 == x:
                a = i
                b = j
                break

    ans = f'{a} {b}'
    print(ans)
    return(ans)


if __name__ == '__main__':
    main()

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

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

print(a,b)

Solution (Python):


def solve():
    X = int(input())
    A, B = 0, 0
    
    
    
    
    for a in range(-118, 119 + 1):
        for b in range(-119, 118 + 1):
            if a ** 5 - b ** 5 == X:
                A, B = a, b
                break
    print(A, B)


if __name__ == '__main__':
    solve()

Solution (Python):


def solve():
    X = int(input())
    A, B = 0, 0
    for a in range(-200, 200):
        for b in range(-200, 200):
            if a ** 5 - b ** 5 == X:
                A, B = a, b
                break
    print(A, B)



if __name__ == '__main__':
    solve()

Solution (Python):
import sys

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

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

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

Solution (Python):
import sys

x = int(input())

b = 0
ans=(-1,-1)
while True:
    a5 = b**5 + x

    
    a = b+1
    if a**5>a5:
        break
    while a**5<a5:
        a+=1
    if a**5==a5:
        ans=(a,b)
        break

    b+=1

if ans[0]!=-1:
    print(ans[0],ans[1])
    sys.exit(0)

b=-1
while True:
    a5=b**5+x

    a=b+1
    while a**5<a5:
        a+=1
    if a**5==a5:
        ans=(a,b)
        break

    b-=1

print(ans[0],ans[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):
import math

X = int(input())
uplim = math.floor((X/5)**(0.25) + 1)
for A in range(uplim+1):
	for B in range(-uplim, uplim+1):
		if A**5 - B**5 == X:
			print(A,B)
			exit()

Solution (Python):
x = int(input())
resA = 0
resB = 0
for a in range(500):
  for b in range(-500,500):
    A = a**5
    B = b**5
    N= A-B
    if A-B==x:
      resA = a
      resB = b
      break
    else:
      pass
  if A-B==x:
    break
print(resA,resB)

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

Solution (Python):
x = int(input())
for i in range(240):
    a = -120 + i
    for j in range(240):
        b = -120 + j
        c = a ** 5 - b ** 5
        if c == x:
            ans1 = a
            ans2 = b
            break
print(str(ans1) + " " + str(ans2))

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):
import math
def divisor(n):
    ans = []
    sqr = int(math.sqrt(n))
    for x in range(1, sqr+1):
        if n % x == 0:
            ans.append(x)
            y = n//x
            if x != y:
                ans.append(y)
    ans.sort()
    return ans

x = int(input())
div = divisor(x)
flag = False
for i in div:
    if flag:
        break
    a = i // 2
    j = x // i
    b = a - i
    jj = a**4+a**3*b+a**2*b**2+a*b**3+b**4
    
    
    while(jj <= j):
        b = a - i
        jj = a**4+a**3*b+a**2*b**2+a*b**3+b**4
        
        
        if j == jj:
            print('{0} {1}'.format(a, b))
            flag = True
            break
        a += 1

Solution (Python):
import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  x=I()
  for a in range(-500,501):
    for b in range(-500,501):
      if a**5-b**5==x:
        return str(a)+' '+str(b)


print(main())

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def f(a, b):
    return pow(a, 5) - pow(b, 5)
 
def main():
    x = int(readline())    
    for i  in range(-1000, 1001):
        for j in range(-1000, 1001):
            if i**5 - j**5 == x:
                print(i, j)
                return
if __name__ == '__main__':
    main()

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def f(a, b):
    return pow(a, 5) - pow(b, 5)
 
def main():
    x = int(readline())    
    for i  in range(-1000, 1001):
        for j in range(-1000, 1001):
            if i**5 - j**5 == x:
                print(i, j)
                return
if __name__ == '__main__':
    main()

Solution (Python):
x = int(input())
for i in range(-120, 121):
    for j in range(-120, 120):
        if i ** 5 - j ** 5 == x:
            print(f'{i} {j}')
            break
    else:
        continue
    break

Solution (Python):
import sys
from io import StringIO
import unittest


def resolve():

    
    x = int(input())

    
    
    for a in range(120):
        
        for b in range(-118, 120, 1):
            if pow(a, 5) - pow(b, 5) is x:
                print('{} {}'.format(a, b))
                return


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """33"""
        output = """2 -1"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """1"""
        output = """0 -1"""
        self.assertIO(input, output)

if __name__ == "__main__":

    
    resolve()

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

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

for i in range(-200,200,1):
    for j in range(-200,200,1):
        if (i**5 - j**5) == X:
            print(str(i) + ' ' + str(j))
            break
    else:
        continue
    break

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

Solution (Python):
X = input().split()
X = int(X[0])
ans = [0]*2

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

        if x == X:
            ans = (i,j)
            break

print(' '.join(map(str,ans)))

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

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

solve()

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

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

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

a=False
for i in range(10**3):
    if a==False:
        for j in range(-10**3,10**3):
            if i**5-j**5==X:
                print(i,j)
                a=True
                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):
def solve(x):
    D = {b**5:b for b in range(-200, 200)}
    for a in range(-200, 200):
        k = x - a**5
        if -k in D:
            return " ".join(map(str, [D[k],-a]))

x = int(input())
print(solve(x))

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

a = 1
b = 0

def val():
    global a, b
    if pow(a,5) - pow(-b,5) == x:
        b = -b
        return True
    return pow(a,5) - pow(b,5) == x

while not val():
    if a >= b:
        b += 1
    else:
        a += 1
        b = 0
print(a,b)

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

for A in range(-118, 120):
    for B in range(-119, 119):
        A5 = pow(A,5)
        B5 = pow(B,5)
        if( (A5-B5) == X):
            ans = str(A) + ' ' + str(B)
            break

print(ans)

Solution (Python):
X = int(input())
li = [i**5 for i in range(0,10000,1)]
for A in li:
    if A-X in li:
        B = li.index(A-X)
        break
    elif A-X < 0:
        if abs(A-X) in li:
            B = (li.index((A-X)*(-1))) * (-1)
            break

print(li.index(A),B)

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(-120, 121):
    for b in range(-120, 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(0)

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

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

num_list = {}
result = [ 0, 0 ]

for i in range(121):
    num_list[i ** 5] = i

for i in num_list:
    temp = i - x
    if(abs(temp) in num_list):
        result[0] = num_list[i]
        if(temp < 0):
            result[1] = num_list[abs(temp)] * -1
        else:
            result[1] = num_list[temp]

        break

print('{} {}'.format(result[0], result[1]))

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

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

Solution (Python):



from random import randint

n = int(input())

for _ in range(10**6):
    x = randint(-200,200)
    y = randint(-200,200)
    if x**5 - y**5 == n:
        print(x,y)
        break;

Solution (Python):



from random import randint

n = int(input())

for _ in range(10**6):
    x = randint(-200,200)
    y = randint(-200,200)
    if x**5 - y**5 == n:
        print(x,y)
        break;

Solution (Python):



n = int(input())
for a in range(n):
    breaked = True
    for b in range(-1000, 1000):
        if a**5 - b**5 == n:
            print(a, b)
            break;
    else:
        breaked = False
    if breaked:
        break

Solution (Python):
n = int(input())
for a in range(n):
    breaked = True
    for b in range(-1000, 1000):
        if a**5 - b**5 == n:
            print(a, b)
            break;
    else:
        breaked = False
    if breaked:
        break

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

Solution (Python):
M=120

X=int(input())

for a in range(-M,M+1):
    for b in range(-M,M+1):
        if a**5-b**5==X:
            A,B=a,b
            break

print(A,B)

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

flag = 0

for i in range(-250,250):
    for j in range(-250,250):
        if(i**5 - j**5 == x):
            print(str(i) + ' ' + str(j))
            flag = True
            break
    if(flag):
        break

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


for i in range(120):
    if x>i**5:
        for j in range(-100,0):
            ans = i**5-j**5
            if ans == x:
                print("{} {}".format(i,j))
                exit()
    else:
        for j in range(0,120):
            ans = i**5-j**5
            if ans == x:
                print("{} {}".format(i,j))
                exit()

Solution (Python):
def func(x,y):
    return x**5-y**5

x = int(input())
a = -200
b = 200
flag = False

for i in range(-199,200):
    for j in range(-200,199):
        if(func(i,j)==x):
            print(i,j)
            flag = True
            break
    if(flag):
        break

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

Solution (Python):

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

    
    
    
    
    
    

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

if __name__ == "__main__":
    main()

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

mid = -150
for A in range(-149,150):
    B1 = -150
    B2 = A-1
    A5 = A**5
    while B2-B1>1:
        mid = (B1+B2)/2
        if A5 - int(mid)**5 == X:
            break
        elif A5 - mid**5 <= X:
            B2 = mid
        else:
            B1 = mid
    if A5 - int(mid)**5 == X:
        break

print(A,int(mid))

Solution (Python):
import sys

readline = sys.stdin.readline
readlines = sys.stdin.readlines
ns = lambda: readline().rstrip() 
ni = lambda: int(readline().rstrip()) 
nm = lambda: map(int, readline().split()) 
nl = lambda: list(map(int, readline().split())) 

x = ni()
ans_a = 0
ans_b = 0
for a in range(-120, 120):
    for b in range(-120, 120):
        if a**5 - b**5 == x:
            ans_a = a
            ans_b = b

print(ans_a, ans_b)

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


if __name__ == "__main__":
    main()

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

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

Solution (Python):
X=int(input())
a=True
for A in range(118+121):
    if(a):
        for B in range(118+121):
            if((A-118)**5-(B-118)**5==X):
                print(A-118,B-118)
                a=False
                break

Solution (Python):
X=int(input())
a=True
for A in range(118+120):
    if(a):
        for B in range(118+120):
            if((A-118)**5-(B-118)**5==X):
                print(A-118,B-118)
                a=False
                break

Solution (Python):
import sys

readline = sys.stdin.readline
readall = sys.stdin.read
ns = lambda: readline().rstrip()
ni = lambda: int(readline().rstrip())
nm = lambda: map(int, readline().split())
nl = lambda: list(map(int, readline().split()))
prl = lambda x: print(*x ,sep='\n')

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

Solution (Python):
def main():
    X = int(input())
    for A in range(0, 201):
        for B in range(-201, 201):
            if pow(A, 5) - pow(B, 5) == X:
                print(A, B)
                return

if __name__ == "__main__":
    main()

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

for i in range(-500,500):
    for j in range(-500,500):
        if (i**5) - (j**5) == x:
            print(str(i) + ' ' + str(j))
            flag = 1
            break
    if flag == 1:
        break

Solution (Python):
x = int(input())
ans = []
for A in range(10**5):
  for B in range(-100,10**4):
    if A**5 -B**5 == x:
      ans.append(A)
      ans.append(B)
      print(*ans)
      exit()

Solution (Python):
from itertools import product

x = int(input())

'''
 x = a^5 - b^5
   = (a - b)(a^4 + a^3 b + a^2 b^2 + a b^3 + b^4)

∵   (a - b)(a^4 + a^3 b + a^2 b^2 + a b^3 + b^4)
   = a^5 + a^4 b + a^3 b^2 + a^2 b^3 + a b^4
         - a^4 b - a^3 b^2 - a^2 b^3 - a b^4 - b^5
   = a^5 - b^5

a - b = ±1 となる解が存在する

このとき、

|x| = |a^4 + a^3 (a ± 1) + a^2 (a ± 1)^2 + a (a ± 1)^3 + (a ± 1)^4|
   ~= |a^4 + a^4 + a^4 + a^4 + a^4|
    = 5 a^4

であるから、1 <= x <= 10^9 に対して |a| <= (x / 5)^(1 / 4) となる

式の対象性より b についても同様な評価ができるので、

∴ -119 <= a, b <= 119 の範囲で解を探索すれば良い
'''

ab_s = product(range(-119, 120), range(-119, 120))

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

Solution (Python):
import math
X=int(input())
x=1
while 1:
    if X<2*pow(x,5):
        break
    x+=1
while 1:
    M=pow(x,5)-X
    if M<0:
        M=-1*M
        if pow(M,0.2)-int(pow(M,0.2))<=pow(10,-6):
            print(x,-1*(int(pow(M,0.2))))
            break
    else:
        if pow(M,0.2)-int(pow(M,0.2))<=pow(10,-6):
            print(x,int(pow(M,0.2)))
            break
    x+=1