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

X = int(sys.stdin.readline().strip())

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

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

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

for i in range(-1000,1000):
  for j in range(-1000,1000):
    num= i**5 -j **5
    if num == X:
      print(i,j)
      flg=True
      break
     
  if flg:
    break

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

Solution (Python):

X = int(input())

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

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

for a in range(120):
    for b in range(120):
        A=a**5
        B=b**5
        if X==A+B:
            print(a,-b)
            exit()
        elif X==A-B:
            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)
            quit()

Solution (Python):
import numpy as np
x = int(input())

i = 0
while True:
    a = i
    b = (np.abs(a**5 - x))**(1/5)
    
    if (a**5-x) < 0 :
        b = -b
    if a**5 - int(b)**5 == x:
        print(a,int(b))
        break
    
    a = -i
    b = (np.abs(a**5 - x))**(1/5)
    if (a**5-x) < 0 :
        b = -b
    if a**5 - int(b)**5 == x:
        print(a,int(b))
        break
    i += 1

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

for a in range(0,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())
found = False
for i in range(-200, 200):
    for j in range(-200, 200):
        if (i ** 5 - j ** 5) == X:
            print(i, j)
            found = True
            break
    if found:break

Solution (Python):

import math
X = int(input())

B = -math.floor(math.pow(X, 0.2))
for b in range(B, 100000):
    tmp = math.pow(X + b ** 5, 0.2)
    if math.floor(math.floor(tmp+1.0e-6) - tmp + 1.0e-6) == 0:
        break
        
tmp = math.floor(tmp + 1.0e-6)
print(tmp, b)

Solution (Python):
x = int(input())
a,b = 0,0

for i in range(-100,300):
    for j in range(-100,300):
        if i**5-j**5==x:
            a,b = i,j
            break

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

    

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


    def isOK(A, B):
        eq = A**5 - B**5
        if eq <= X:
            return True
        else:
            False
    
    def bin_search(B):
        
        
        left = B
        right = 10 ** 4 * 2

        while right - left > 1:
            mid = left + (right - left) // 2
            if isOK(mid, B):
                left = mid
            else:
                right = mid

        return left
    

    for B in range(-10**4, 10**4 + 1):
        A = bin_search(B)
        if A**5 - B**5 == X:
            print(A, B)
            exit()
            
if __name__ == "__main__":
    main()

Solution (Python):

from itertools import combinations_with_replacement
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

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

    ab = [i**5 for i in range(200)]

    C = combinations_with_replacement(ab, 2)
    for a, b in C:
        if a + b == x:
            print(int(pow(b, 0.2)), -int(pow(a, 0.2)))
            break
        
        if b - a == x:
            print(int(pow(b, 0.2)), int(pow(a, 0.2)))
            break


if __name__ == "__main__":
    main()

Solution (Python):
import math

x=int(input())

def main():
    for i in range(-130,130):
        for j in range(-130,130):
            if i**5-j**5==x:
                print(i,j)
                return

if __name__ == '__main__':
    main()

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

Solution (Python):



def solve(*args: str) -> str:
    x = int(args[0])

    ret = None
    for b in range(120):
        for a in range(b, 120):
            a5, b5 = pow(a, 5), pow(b, 5)
            if a5-b5 == x:
                ret = (a, b)
                break
            elif a5+b5 == x:
                ret = (a, -b)
                break

    return ' '.join(map(str, ret))


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))

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

Solution (Python):
from sys import *

def get(n):
	return n * n * n * n * n

X = int(stdin.readline())
for a in range(0, 10001):
	A = get(a)
	B = abs(A - X)
	lo = 0
	hi = 10000
	b = -1
	ok = False
	while lo <= hi:
		mid = (lo + hi) // 2
		sum = get(mid)
		if sum is B:
			b = mid
			ok = True
			break
		if sum < B:
			lo = mid + 1
		else:
			hi = mid - 1
	if ok is True:
		if A < X:
			b = -b
		print("{} {}".format(a, b))
		exit()

Solution (Python):



def solve(*args: str) -> str:
    x = int(args[0])

    ret = None
    for b in range(120):
        for a in range(b, 120):
            a5, b5 = pow(a, 5), pow(b, 5)
            if a5-b5 == x:
                ret = (a, b)
            elif a5+b5 == x:
                ret = (a, -b)

    return ' '.join(map(str, ret))


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))

Solution (Python):

    

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


    def isOK(A, B):
        eq = A**5 - B**5
        if X >= eq:
            return True
        else:
            False
    
    def bin_search(B):
        
        left = B + 1
        right = 10 ** 4 * 2

        while right - left > 1:
            mid = left + (right - left) // 2
            if isOK(mid, B):
                left = mid
            else:
                right = mid

        return left
    

    for B in range(-10**4, 10**4 + 1):
        A = bin_search(B)
        if A**5 - B**5 == X:
            print(A, B)
            exit()


if __name__ == "__main__":
    main()

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

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


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

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

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

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

Solution (Python):



def solve(*args: str) -> str:
    x = int(args[0])

    ret = None
    for a in range(120):
        for b in range(120):
            a5, b5 = pow(a, 5), pow(b, 5)
            if a5-b5 == x:
                ret = (a, b)
            elif a5+b5 == x:
                ret = (a, -b)

    return ' '.join(map(str, ret))


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))

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

Solution (Python):
x = int(input())
found = False
a = 0
b = 0

for i in range(-200, 201):
  for j in range(-200, 201):
    if i**5-j**5==x:
      found = True
      a = i
      b = j
  if found:
    break
    
print(a, b)

Solution (Python):
X = int(input())
ans = list()
min = float("inf")
r = range(-200,200)
for A in r:
  for B in r:
    if A**5-B**5==X:
      if A**5-B**5< min:
        if len(ans)!=0: ans.pop()      
        ans.append([A,B])
        min = A**5-B**5
        break
      elif A**5-B**5==min:
        ans.append([A,B])
        break
ans=ans[1]
A = ans[0]
B = ans[1]
print(A, B)

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

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

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

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

Solution (Python):

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

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


main()

Solution (Python):
import math
X = int(input())
a1 = math.ceil(X**(1/5))
N = int(1e10)
c = 0
b = 0
while c <= N:
    if b**5 < -X:
        b2 = b + 1
        break
    b -= 1
c = 0
while c <= N:
    c += 1
    b1 = math.floor((a1**5-X)**(1/5))
    a2 = math.floor((X+b2**5)**(1/5))
    if a1**5 - b1**5 == X:
        print(a1, b1)
        break
    elif a2**5 - b2**5 == X:
        print(a2, b2)
        break
    a1 += 1
    b2 += 1

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

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


if __name__ == '__main__':
    main()

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

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

Solution (Python):
from collections import defaultdict as dc
x = int(input())
d = dc(lambda:0)
for i in range(200):
    d[i**5] = i

f=0
l = list(d.items())

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

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

for i in range(10 ** 8):
    for j in range(-10000,10 ** 4):
        if i ** 5 - j ** 5 == X:
            print(i, j)
            exit()

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

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

Solution (Python):
import math
x=int(input())
for i in range(120):
 for j in range(-54,i):
  if math.pow(i,5)-math.pow(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):
from math import floor,ceil,sqrt
import fractions
import collections
import itertools
from collections import deque
X=int(input())
"""
l=[]
for i in range(1,ceil(sqrt(X))+1):
    if X%i==0:
        l.append(i)
        l.append(X//i)
l=list(set(l))
l2=l
for i in range(len(l)):
    l2.append(-l[i])

l2.sort()
if len(l)!=0:
    for i in l2:
        x=X//i
        
        n=(x-pow(i,4))/(pow(i,2)+1)
        
        if (5*pow(i,4)+20*x)>=0:
            if sqrt((5*pow(i,4)+20*x)).is_integer()==True:
                
                m=int(sqrt((5*pow(i,4)+20*x)))
                if (-5*i*i+m)%10==0:
                    y=(-5*i*i+m)//10
                    
                    if pow(i,2)+4*y>=0:
                        if sqrt(pow(i,2)+4*y).is_integer()==True:
                            z=int(sqrt(pow(i,2)+4*y))
                            if (-i+z)%2==0:
                                b=(-i+z)//2
                                a=i+b
                                print(a,b)
                                break
                            elif (-i - z) % 2 == 0:
                                b = (-i - z) // 2
                                a = i + b
                                print(a, b)
                                break
                elif (-5*i*i-m)%10==0:
                    y=(-5*i*i+m)//10
                    
                    if pow(i,2)+4*y>=0:
                        if sqrt(pow(i,2)+4*y).is_integer()==True:
                            z=int(sqrt(pow(i,2)+4*y))
                            if (-i+z)%2==0:
                                b=(-i+z)//2
                                a=i+b
                                print(a,b)
                                break
                            elif (-i - z) % 2 == 0:
                                b = (-i - z) // 2
                                a = i + b
                                print(a, b)
                                break
"""
flag=0

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

Solution (Python):
x = int(input())
def f1(a, b): return a**5 - b**5
def f2(a, b): return a**5 + b**5
for f, sign_b in ((f1, 1), (f2, -1)):
    b = 0
    while f(a := b + 1, b) <= 10**9:
        while f(a, b) <= 10**9 and f(a, b) != x:
            a += 1
        if f(a, b) == x:
            print(a, sign_b * b)
            exit(0)
        b += 1

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

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

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

Solution (Python):
x=int(input())
for i in range(120):
 for j in range(-62,i):
  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 a**5 - b**5 == x:
      print(a, b)
      break
  else:
    continue
  break

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

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 6)  
to_index = lambda x: int(x) - 1  
print_list_in_2D = lambda x: print(*x, sep="\n")  


def input_int():
    return int(input())

def map_int_input():
    return map(int, input())

MII = map_int_input

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

def MII_to_index():
    return map(to_index, input())

def MII_split_to_index():
    return map(to_index, input().split())


def list_int_inputs():
    return list(map(int, input()))

LII = list_int_inputs

def LII_split():
    return list(map(int, input().split()))


def LII_2D(rows_number):
    return [LII() for _ in range(rows_number)]

def LII_split_2D(rows_number):
    return [LII_split() for _ in range(rows_number)]

X = input_int()

for a in range(2000):
    A = a - 1000

    for b in range(2000):
        B = b - 1000
        if A ** 5 - B ** 5 == X:
            print("{} {}".format(A, B))
            exit()

Solution (Python):
import time
startTimeProblem=time.time()

import fileinput, sys, itertools, functools
from math import *
from bisect import *
from heapq import *
from collections import *

def lcm(a, b):  
    return (a*b)/gcd(a, b)

class InputHelper:
    def __init__(self):
        self.myinput = fileinput.input()

    def isLocal(self):
        return not fileinput.isstdin()

    def int(self):
        return int(self.myinput.readline().rstrip())

    def ints(self):
        return [int(_) for _ in self.myinput.readline().rstrip().split()]

    def str(self):
        return self.myinput.readline().rstrip()

    def strs(self):
        return [_ for _ in self.myinput.readline().rstrip().split()]

class OutputHelper:
    def int(self, a):
        print(a)    

    def ints(self, a):  
        print(" ".join([str(_) for _ in a]))
    
    def intsNL(self, a):
        for _ in a:
            print(_)
    
    def str(self, s):
        print(s)

    def strs(self, s):
        print(" ".join([_ for _ in s]))

    def strsNL(self, s):
        for st in s:
            print(st)

class ListNode:
    def __init__(self, val):
        self.val = val
        self.next = None
        self.prev = None

In = InputHelper()
Out = OutputHelper()



X = In.int()

there = dict()

B = 0
B5 = 0

while B5<10**12:
    B5 = B**5
    there[B5] = B
    if B5 != 0:
        there[-B5] = -B
    B+=1

A = 0
A5 = 0

while A5<10**12:
    A5 = A**5
    
    if A5-X in there:
        Out.ints([A, there[A5-X]])
        break
    A+=1



if len(sys.argv)>2 and sys.argv[2]=="TIMEIT":
    fin = (time.time()-startTimeProblem)*1000
    print("{:.2f}".format(fin) + "ms")

Solution (Python):

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

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

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

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

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

Solution (Python):

import numpy as np

x = int(input())
flg = 0

for i in range(1, x+1):
    if x % i != 0:
        continue
    else:
        for a in range(x):
            b = a - i
            if a**5 - b**5 == x:
                ans_a = a
                ans_b = b
                flg = 1
                break
            elif a > i and a**5 - b**5 > x:
                flg = -1
                break
        if flg == 1:
            break
        elif flg == -1:
            flg = 0
            continue

print(ans_a, ans_b)

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

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

a = [i**5 for i in range(1000)]
for i in range(1000):
    for j in range(i+1, 1000):
        if a[j] - a[i] == n:
            print(j, i)
            exit()
        if a[j] + a[i] == n:
            print(j, -i)
            exit()

Solution (Python):
x=int(input())
for i in range(120):
  for j in range(-95,i):
    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:
            ans=[a,b]
            print(*ans)
            exit()

Solution (Python):
from decimal import Decimal
n = int(input())
nn = int(pow(n,1/5)) + 1
for i in range(-200,200):
    cheak = i ** 5 - n
    ans = float(pow(Decimal(abs(cheak)), Decimal("0.2")))

    if type(ans) is float:

        if ans.is_integer():
            if cheak < 0:
                b = -1 * ans
            else:
                b = ans
            print(i,int(b))
            break

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

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

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

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

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


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


if __name__ == '__main__':
    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)
            break
    else:
        continue
    break

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

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

Solution (Python):
import sys
import os
import math
import bisect
import collections
import itertools

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

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


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


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    X = ii()

    for a in range(-120, 120):
        for b in range(-120, 120):
            if f(a, b) == X:
                print(a, b)
                exit()


if __name__ == '__main__':
    main()

Solution (Python):
import sys
import os
import math
import bisect
import collections
import itertools

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

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


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


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    X = ii()
    LIST = [i ** 5 for i in range(1001)]

    for a in range(1001):
        for b in range(a + 1, 1001):
            if LIST[b] - LIST[a] == X:
                print(b, a)
                exit()
            if LIST[b] + LIST[a] == X:
                print(b, -a)
                exit()


if __name__ == '__main__':
    main()

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

flag = False
for A in range(-130, 130):
    for B in range(-130, 130):
        
        if A ** 5 - B ** 5 == X:
            print(A, B)
            flag = True
            break
    if flag:
        break

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

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

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

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

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

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

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

if __name__ == '__main__':
    main()

Solution (Python):




import sys
input = sys.stdin.readline



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

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




main()

Solution (Python):
import sys
from math import pow
def main():
    x = int(input())
    for a in range(-1000,1001):
        for b in range(-1000,1001):
            if pow(a, 5) - pow(b, 5) == x:
                print(a, b)
                sys.exit()

if __name__ == '__main__':
    main()

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

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

  for A in range(-120, 120):
    for B in range(-120, 120):
      if A**5 - B**5 == X:
        print("{0} {1}".format(A, B))
        return True

if __name__ == "__main__":
    resolve()

Solution (Python):
import math
x = int(input())
for i in range(-118,120):
  for j in range(-119,129):
    if math.pow(i, 5) - math.pow(j, 5) == x:
      print(i, j)
      exit()

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from itertools import combinations
def main():
    X = int(readline())
    p = [int(i) for i in range(-1000, 1001)]
    for b, a in combinations(p, 2):
        if a**5 - b**5 == X:
            A = a
            B = b
            break
    print(A, B)
if __name__ == '__main__':
    main()

Solution (Python):
import math
def main():
  x = int(input())
  for i in range(-118,120):
    for j in range(-119,129):
      if math.pow(i, 5) - math.pow(j, 5) == x:
        print(str(i) + ' ' + str(j))
        return
main()

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

Solution (Python):
import math
def main():
  x = int(input())
  for i in range(-120,120):
    for j in range(-120,120):
      if math.pow(i, 5) - math.pow(j, 5) == x:
        print(str(i) + ' ' + str(j))
        return
main()

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

for a in range(-300, 300):
    for b in range(-300, 300):
        if a ** 5 - b ** 5 == X:
            A = a
            B = b

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

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

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

for a in range(-500,500):
  for b in range(-500,500):
    if a**5-b**5==x:
      c=a
      d=b
      break
      
print(c,d)

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def main():
    X = int(readline())
    for b in range(-1000, 1001):
        for a in range(b, 1001):
            if a**5 -b**5 == X:        
                A = a
                B = b
                break
    print(A, B)            
if __name__ == '__main__':
    main()

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

Solution (Python):
import sys
sys.setrecursionlimit(10**8)
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 li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]
import bisect 




X = ii()
'''
lim = 10**3

for a in range((-1)*lim, lim+1):
    for b in range((-1)*lim, lim+1):
        if a**5 - b**5 == X:
            print(a, b)
            exit()
'''
i = 0
while True:
    for j in range((-1)*i, i):
        if i**5 - j**5 == X:
            print(i, j)
            exit()
    i += 1

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

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

    def search(y):
        left = -10**18
        right = 10**18

        while right - left > 1:
            mid = (right+left)//2

            if mid**5 < y:
                left = mid
            else:
                right = mid

        return right

    for b in range(-1000,1000):
        y = X+b**5
        a = search(y)

        if a**5-b**5 == X:
            print(a,b)
            exit()




if __name__ == "__main__":
  main()

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

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

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

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    save = -1
    for i in range(len(divisors)):
        if divisors[i] >= 200:
            save = i
            break
    if save > 0:
        divisors = divisors[:save]
    return divisors

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

divs = make_divisors(X)
ans = 0
for div in divs:
  a = -div-120
  b = -120
  while f(a, b) < X and a < 2:
    a += 1
    b += 1
  if f(a, b) == X:
    ans = (a, b)
  a = -120
  b = -div-120
  while f(a, b) > X and b < 2:
    a += 1
    b += 1
  if f(a, b) == X:
    ans = (a, b)
    
print(ans[0], ans[1])

Solution (Python):

def resolve():
    X = int(input())
    for a in range(-120, 121):
        for b in range(-120, 121):
            if X == (a**5 - b**5):
                print(a, b)
                return

if __name__ == "__main__":
    resolve()