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):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

x = ii()
l = [0]
i = 0
num = 0
while num < 10**15:
    i += 1
    num = i**5
    l.append(num)

l = set(l)
for item in l:
    if item > x:
        if item - x in l:
            print(int(item**0.2),int((item-x)**0.2))
            exit()
    else:
        if x - item in l:
            print(int(item**0.2),int((x-item)**0.2)*(-1))
            exit()

'''
    if x - item in l:
        print(int(item**0.2),int(abs(item-x)**0.2)*(-1))
        exit()
    elif item - x in l:

        print(int(item**0.2),int(abs(item-x)**0.2)*(-1))
        exit()
'''

Solution (Python):
from sys import stdin

def main():

    input = stdin.readline

    X = int(input())

    min_num =  6000

    for i in range(-min_num,min_num+2):
        A_5 = i ** 5

        for j in range(-min_num,min_num+2):
            B_5 = j ** 5

            if(A_5 - B_5 == X):
                print(i,j)
                return

if __name__ == "__main__":
    main()

Solution (Python):

import sys

def show():
    for i in range(100):
        print(i, i**5)

def solve(X: int):
    A = [(i ** 5, i) for i in range(1000)]
    for a, b in A:
        for aa, bb in A:
            if a  - aa == X:
                return b, bb
            if a + aa == X:
                return b, -bb
    raise



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

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    
    main()

Solution (Python):
import itertools

x = int(input())

num = []

for i in range(201):
    num.append(i ** 5)

for a5, b5 in itertools.permutations(num, 2):
    if a5 - b5 == x:
        print(num.index(a5), num.index(b5))
        break
    elif a5 + b5 == x:
        print(num.index(a5), num.index(b5) * (-1))
        break

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

rs = [i ** 5 for i in range(300)]

for r in rs:
    if r <= x:
        if x - r in rs:
            print(rs.index(r), - rs.index(x - r))
            break
    if r > x:
        if r - x in rs:
            print(rs.index(r), rs.index(r - x))
            break

Solution (Python):

import sys, re
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from heapq import heappush, heappop, heapify, nlargest, nsmallest
def STR(): return list(input())
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def list2d(a, b, c): return [[c] * b for i in range(a)]
def sortListWithIndex(listOfTuples, idx):   return (sorted(listOfTuples, key=lambda x: x[idx]))
def sortDictWithVal(passedDic):
    temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))
    toret = {}
    for tup in temp:
        toret[tup[0]] = tup[1]
    return toret
def sortDictWithKey(passedDic):
    return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

dd=defaultdict(int)

for i in range(0, 121):
    for j in range(i+1):
        temp = i**5 - j**5
        dd[temp] = (i, j)
        temp1 = i**5 + j**5
        dd[temp1] = (i, -j)

x = INT()
if(dd[x]!=0):
    print(dd[x][0], dd[x][1])

Solution (Python):
from decimal import Decimal

x = int(input())
now = 0
while True:
    tmp = now ** 5
    need = abs(tmp - x)
    sqrt = Decimal(str(need)) ** Decimal("0.2")
    if sqrt % 1 == 0:
        if tmp - x > 0:
            print(now, int(sqrt))
        else:
            print(now, int(sqrt) * -1)
        break
    now += 1

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

    divisors.sort()
    return divisors
  
x = int(input())
lis = make_divisors(x)
flg = False

for i in range(0, len(lis)):

  for j in range(-1000,1000):
    if (j+lis[i])**5 -j**5 ==x:
      ans = str(j+lis[i])+' '+str(j)
      
      break


if flg:
  for i in range(0, len(lis)):
    for j in range(-1000,1000):
      if (j+lis[i])**5 -j**5 ==x:
        ans = str(j+lis[i])+' '+str(j)
        break

  
print(ans)

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

flag = 0
for i in range(-200, 200):
    for j in range(-200, 200):
        if i ** 5 - j ** 5 == x:
            print(i, j)
            flag = 1
            break
    if flag == 1:
        break

Solution (Python):
import sys
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

X = int(read())

x = np.arange(-300, 300, dtype=np.int64)

x5 = x**5
diff = np.subtract.outer(x5, x5)

i = np.where(diff == X)

x, y = i[0][0], i[1][0]
x -= 300
y -= 300

assert x**5 - y**5 == X
print(x, y)

Solution (Python):
X = int(input())
A=[]

for i in range(-200, 200):
    A.append(i**5)
t=False

for i in range(len(A)):
    for j in range(len(A)):
        if A[i]-A[j]==X:
            print(i-200,j-200)
            t=True
            break
    if t:
        break

Solution (Python):
import sys

X = int(input())
i = 0

while 1:
    i += 1
    for j in range(-i+1, i):
        if i**5 - j**5 == X:
            print(i, j)
            sys.exit()

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

A = [i for i in range(500)]
B = [i for i in range(-500, 500)]

for a in A:
	for b in B:
		if a - b != 0:
			if x % (a - b) == 0:
				if a ** 5 - b ** 5 == x:
					print(a, b)
					exit()

Solution (Python):
import math

X = int(input())

num_list = [i ** 5 for i in range(-120, 121)]

for i in range(len(num_list)-1):
    for j in range(i,len(num_list)):
        if num_list[j] - num_list[i] == X:
            A = -120 + j
            B = -120 + i
            print(A, B)
            break
    else:
        continue
    break

Solution (Python):
from math import sqrt
import sys


X = int(input())

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

for x in range(1, int(sqrt(X))):
    if X % x == 0:
        flg = False
        for a in range(1000000):
            if (a-1) ** 5 - (a-1-x) ** 5 < a ** 5 - (a-x) ** 5:
                flg = True
            if flg and a ** 5 - (a-x) ** 5 > X:
                break
            if a ** 5 - (a-x) ** 5 == X:
                print(a, a-x)
                sys.exit()

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

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

for A in range(1000):
    A5 = A**5
    for B in range(1000):
        B5 = B**5
        if A5 - B5 == X:
            print(A, B)
            exit()
        elif A5 + B5 == X:
            print(A, -B)
            exit()
        else:
            continue

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

Solution (Python):
import sys
def calc(a, b):
    c = a - b
    d = a**4 + a**3 * b + a**2 * b**2 + a * b**3 + b**4
    
    return c * d

X = int(input())

for i in range(-10**3, 10**3 + 1):
    for j in range(-10**3, 10**3 + 1):
        if calc(i, j) == X:
            print(f"{i} {j}")
            sys.exit()

Solution (Python):
X=int(input())
num_list=[i-120 for i in range(240)]
temp=0
for A in num_list:
  for B in num_list:
    if A**5-B**5==X:
      print(A,B)
      temp=1
      break
  if temp==1:
    break

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

  for i in range(1,int(math.sqrt(X))+1):
    if X % i == 0:
      A = -int(X**(1/5))
      B = A - i
      while A**5-B**5>X:
        A = A+1
        B = A-i
      while A**5-B**5<=X:
        if A**5-B**5==X:
          print(A,B)
          return
        A = A + 1
        B= A - i
        
solve()

Solution (Python):
X = int(input())
k = list(range(0,100000))
k5 = []
for i in k:
    k5.append(i**5)
for j in k5:
    if X + j in k5:
        print(k[k5.index(X+j)],k[k5.index(j)])
        exit()
    elif X - j in k5:
        print(k[k5.index(X-j)],-k[k5.index(j)])
        exit()

Solution (Python):
X = int(input())
hantei = 0
for i in range(-200,200):
    for j in range(-200,200):
        if i**5-j**5 == X:
            print(i,j)
            hantei = 1
            break
    else:
        continue
    break

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

running = True
for a in range(-1000, 1001):
    if not running:
        break
    for b in range(-1000, 1001):
        if a**5 - b**5 == X:
            print(a, b)
            running = False
            break

Solution (Python):

import sys
sysread = sys.stdin.readline

import math
def run():
    X = int(input())
    s = int(X ** (1/5))
    for A in range(s+1):
        B = -((-A**5 + X)**(1/5))
        if abs(round(B) - B) < 1e-6:
            print(A, int(B))
            return None
    for A in range(s+1, X+1):
        B = (A ** 5 - X) ** (1 / 5)
        if abs(round(B) - B) < 1e-8:
            print(A, int(B))
            return None


if __name__ == "__main__":
    run()

Solution (Python):
x = int(input())
if int(x**0.2)==int(x)**0.2:
  print(int(x**0.2),0)
  exit()
for i in range(1,10**5):
  b = i
  c = -i
  x1 = x + b**5
  x2 = x + c**5
  if x1>=0 and int(x1**0.2)**5==x1:
    print(int(x1**0.2),b)
    exit()
  if x2>=0 and int(x2**0.2)**5==x2:
    print(int(x2**0.2),c)
    exit()
  if x2<0:
    for j in range(1,10**3):
      v = -j
      if v**5==x2:
        print(v,c)
        exit()

Solution (Python):
X = int(input())
k = 0
for a in range(151):
    for b in range(-150,150):
        if X == a**5 - b**5:
            print("{} {}".format(a,b))
            k = 1
            break
    if k == 1:
        break

Solution (Python):
from itertools import combinations
X = int(input())
l = [(0,0)]
for i in range(1,121):
    a = pow(i,5)
    l.append((a,i))
    l.append((-a,-i))
for x in combinations(l,2):
    if abs(x[0][0]-x[1][0]) == X:
        if x[0][0]-x[1][0] > 0:
            ans = [x[0][1],x[1][1]]
        else:
            ans = [x[1][1],x[0][1]]
        break
print(*ans)

Solution (Python):
def main():
    x = int(input())
    for i in range(-1000, 1000):
        m = x + i ** 5 
        if m >= 0:
            if (m ** 0.2 - int(m**0.2)) <= 10e-5:
                B = i
                break
    A = (x + B ** 5)**0.2
    print(int(A), B)
    

if __name__ == "__main__":
    main()

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


c = 0
l = []
idx = []
bre = False
for i in range(-1800, 1800):
    idx.append(i)
    l.append(i**5)


for i in range(len(l)):
    if bre:
        break
    for j in range(len(l)):
        if l[i]-l[j] == x:
            a = i
            b = j
            bre = True
            break
    
    
    

print(idx[a], idx[b])

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

Solution (Python):
x = int(input())
for i in range(-10000, 10000):
	z = x - i**5
	if int((z**(1.0/5)).real)**5 == z:
		print(int((z**(1.0/5)).real), -1*i)
		break

Solution (Python):


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

    def f(a, b):
        return a**4+(a**3)*b+(a**2)*(b**2)+a*(b**3)+b**4

    def divisor(n):
        
        i = 1
        ans = []
        while i*i <= n:
            if n%i == 0:
                ans.append(i)
                if i != n//i:
                    ans.append(n//i)
            i += 1
        return ans

    
    
    ds = divisor(X)

    for d in ds:
        a = 0
        cnt = X**(1/2)+1
        while cnt > 0:
            cnt -= 1
            b = a - d
            ff = f(a,b)
            if ff == X//d:
                print(a, b)
                return
            
            
            a += 1

        a = 0
        cnt = X**(1/2)+1
        while cnt > 0:
            cnt -= 1
            b = a - d
            ff = f(a,b)
            if ff == X//d:
                print(a, b)
                return
            
            
            a -= 1


if __name__ == "__main__":
    solve()

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

a = 0
b = 0

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

Solution (Python):
X=int(input())
A=[]
B=[]
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()

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






a = 0
b = 0
for k in range(-500,501):
    for h in range(-500,501):
        if k**5 - h**5 == x:
            a = k
            b = h
            break

print(a, b)

Solution (Python):
X = int(input())
a = 0
while True:
    a5 = a**5
    d  = X-a5
    if d >= 0:
        c  = d**0.2
        b1 = int(c)
        b2 = b1+1
        if a5 + b1**5 == X:
            print(a,-b1)
            break
        if a5 + b2**5 == X:
            print(a,-b2)
            break
    else:
        c = ((-d)**0.2)
        b1 = int(c)
        b2 = b1+1
        if a5 - b1**5 == X:
            print(a,b1)
            break
        if a5 - b2**5 == X:
            print(a,b2)
            break
    a += 1

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

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

p = 1
while p * p <= x:
    if x % p != 0:
        p += 1
        continue

    q = x // p
    a = 0
    while a < 1000:
        b = a - p
        f = a**4 + a**3 * b + a**2 * b**2 + a * b**3 + b**4
        if f == q:
            print(a, b)
            exit(0)
        a += 1
    p += 1

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)

    
    return divisors
L=make_divisors(X)
Y=False
ans=[]
for x in L:
    a=0
    while True:
        tmp=a**5-(a-x)**5
        if tmp==X:
            Y=True
            ans=[a,a-x]
            break
        if tmp>X and a>int(X**0.2)+1:
            break
        a+=1
        
    if Y:
        break
print(ans[0],ans[1])

Solution (Python):
def f(n):
    low, high = -1100, 1100
    while high - low > 1:
        mid = (high + low) // 2
        if mid**5 <= n:
            low = mid
        else:
            high = mid
    return low

x = int(input())
for a in range(1000):
    b = f(a**5 - x)
    if a**5 - b**5 == x:
        print(a, b)
        quit()

Solution (Python):
x=int(input())
for n in range(1,int(x**0.5)+1):
    if x%n==0:
        for a in range(int(x**0.5)+1):
            if 5*a**4-10*a**3*n+10*a**2*n**2-5*a*n**3+n**4==x//n:
                print(str(a)+" "+str(a-n))
                break
            a=-a
            if 5*a**4-10*a**3*n+10*a**2*n**2-5*a*n**3+n**4==x//n:
                print(str(a)+" "+str(a-n))
                break
        else:
            continue
        break

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

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

ok = False
for d in divisor:
    if ok:
        break

    for x in range(-1000, 1000):
        v = x ** 5 - (x - d) ** 5
        if v == X:
            print(x, x - d)
            ok = True
            break

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

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

for A in range(0,10**3):
 for B in range(0,10**3):
  A1,A2,B1,B2 = A,-A,B,-B
  if(A1**5-B1**5 == X):
    ans = [A1,B1]
    break
  elif(A1**5-B2**5 == X):
    ans = [A1,B2]
    break
  elif(A2**5-B1**5 == X):
    ans = [A2,B1]
    break  
  elif(A2**5-B2**5 == X):
    ans = [A2,B2]
    break    
            
print(ans[0],ans[1])

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())
dic={}
for i in range(1,120):
  dic[i**5]=i
for i in range(1,120):
  a=i**5
  if a>x:
    if a-x in dic.keys():
      print(str(i)+' '+str(dic[a-x]))
      break
  elif a<x:
    if x-a in dic.keys():
      print(str(i)+' -'+str(dic[x-a]))
      break
  else:
    if a in dic.keys():
      print(str(i)+' 0')
      break

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

Solution (Python):


def input_one_number():
    return int(input())
def out2(n,m):
	print(str(n)+ " " + str(m) )
	exit()


X = input_one_number()

for i in range(1000000):
	for j in range(i+1):
		if j**5 - (i-j)**5 == X:
			out2(j,(i-j))
		if -j**5 - (i-j)**5 == X:
			out2(-j,(i-j))
		if -j**5 + (i-j)**5 == X:
			out2(-j,-(i-j))
		if j**5 + (i-j)**5 == X:
			out2(j,-(i-j))

Solution (Python):
x = int(input())
c = int(x**(1/3))
if c == x**(1/3):
    print(0, -1*c)
else:
    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())

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

for C in factors:
    for A in range(1000):
        B=A-C
        if A**5-B**5==X:
            print(A,B)
            exit()

Solution (Python):

import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue
from decimal import *


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [Scanner.string() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [Scanner.int() for i in range(n)]


class Math():
    @staticmethod
    def gcd(a, b):
        if b == 0:
            return a
        return Math.gcd(b, a % b)

    @staticmethod
    def lcm(a, b):
        return (a * b) // Math.gcd(a, b)

    @staticmethod
    def divisor(n):
        res = []
        i = 1
        for i in range(1, int(n ** 0.5) + 1):
            if n % i == 0:
                res.append(i)
                if i != n // i:
                    res.append(n // i)
        return res

    @staticmethod
    def round_up(a, b):
        return -(-a // b)

    @staticmethod
    def is_prime(n):
        if n < 2:
            return False
        if n == 2:
            return True
        if n % 2 == 0:
            return False
        d = int(n ** 0.5) + 1
        for i in range(3, d + 1, 2):
            if n % i == 0:
                return False
        return True


def pop_count(x):
    x = x - ((x >> 1) & 0x5555555555555555)
    x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)
    x = (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f
    x = x + (x >> 8)
    x = x + (x >> 16)
    x = x + (x >> 32)
    return x & 0x0000007f


MOD = int(1e09) + 7
INF = int(1e15)


def solve():
    X = Scanner.int()
    L = [(0, 0) for _ in range(1000)]
    for i in range(0, 1000):
        L[i] = (i, i ** 5)
    for l1 in L:
        for l2 in L:
            a, b = l1[1], l2[1]
            c, d = l1[0], l2[0]
            if a < b:
                continue
            if a - b == X:
                print(c, d)
                return
            elif a + b == X:
                print(c, -d)
                return


def main():
    
    solve()


if __name__ == "__main__":
    main()

Solution (Python):

X = int(input())

a = [-500 + i for i in range(1001)]
b = [-500 + i for i in range(1001)]

A = -1000
B = -1000
for i in range(1001):
    for j in range(1001):
        
        
        
        
        if(a[i] ** 5 - b[j] ** 5 == X):
            A = a[i]
            B = b[j]
print('{} {}'.format(A, B))

Solution (Python):
import sys

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

    for a in range(-1000, 1000):
        for b in range(-1000, 1000):

            if X == a**5 - b**5:
                break

        else:
            continue
        break

    print(a, b)
    return

if __name__ == '__main__':
    main()
    sys.exit(0)

Solution (Python):
x = int(input())
B = True
a = 0
while B == True:
    btarget = a ** 5 - x
    b = 0
    if btarget >= 0:
        while b ** 5 <= btarget:
            if b ** 5 == btarget:
                print(a, b)
                exit()
            b += 1
    else:
        while b ** 5 >= btarget:
            if b ** 5 == btarget:
                print(a, b)
                exit()
            b -= 1
    a += 1

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


def check(a, b, x):
    if a ** 5 - b ** 5 == x:
        return True
    else:
        return False


def main():
    x = int(input())
    l = make_divisors(x)
    for a in range(1000):
        for b in range(-1000, 1000):
            if check(a, b, x):
                print(a, b)
                exit()


if __name__ == '__main__':
    main()

Solution (Python):
import sys



x = int(input())

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

Solution (Python):

import copy
import random
import bisect 
import fractions 
import math
import sys
import collections

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

d = collections.deque()
def LI(): return list(map(int, sys.stdin.readline().split()))

X = int(input())

def solve(X):
    for a in range(1000):
        for b in range(-1000, 1000):
            a ** 5 - b ** 5
            if a ** 5 - b ** 5 == abs(X):
                return a, b

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

Solution (Python):
import numpy as np
def check(x):
    x=abs(x)
    n=int(x**(float(0.2)))
    return n**5==x
def sol(x):
    for i in range(1,1001):
        if (check(i**5-x)):
            print (i,int(np.sign(i**5-x)*abs(i**5-x)**(float(0.2))))
            return

if __name__=='__main__':
    x=int(input())
    sol(x)

Solution (Python):
a=int(input())
for i in range(int(2*abs(a**(1/5)))+1):
    for j in range(int(2*abs(a**(1/5)))+1):
        if i**5+j**5==a:
            ans1=i
            ans2=j*-1
            break
        elif i**5-j**5==a:
            ans1=i
            ans2=j
            break
        elif j**5-i**5==a:
            ans1=i*-1
            ans2=j*-1
        elif (i**5-j**5)*-1==a:
            ans1=i*-1
            ans2=j
print(str(ans1)+' '+str(ans2))

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

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

testa = 0
while True:
    testb = int((abs((testa**5)-x))**(0.2))
    if testa**5 - x < 0:
        testb *= -1
    if (testa**5-testb**5) == x:
        print(testa,testb)
        exit()
    testa += 1

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

    divisors.sort()
    return divisors
x=int(input())
l=make_divisors(x)
ll=[(i,i-j) for i in range(200) for j in l]
for a,b in ll:
  if a**5-b**5==x:
    print(a,b)
    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())
lis = []
for i in range(-200, 201):
    lis.append(i**5)
flag = 0
for a, i in enumerate(lis):
    for b, j in enumerate(lis):
        if (i + j == X) or (j - i == X):
            flag = 1
            break
    if flag == 1:
        break
    
print((a-200)*(-1), (b-200)*(-1))

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

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

Solution (Python):
X = int(input())
Acount = 0
Bcount = 0
di= {}
def func(i):
    return i**5
for i in range(5000):
    di[str(func(i))] = str(i)
preA = int(X **(1/5))-1000
while True:
    funcA = preA**5
    if funcA-X>=0 and str(funcA-X) in di.keys():
        print(str(preA)+" "+di[str(funcA-X)])
        break
    elif X-funcA>= 0 and str(X-funcA) in di.keys():
        print(str(preA)+" -"+di[str(X-funcA)])
        break
    preA += 1

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

	divisors.sort()
	return divisors

x = int(input())

l = make_divisors(x)

for i in range(max(len(l)//2,1)):
	a = -10**3+l[i]
	b = -10**3
	
	while True:
		num = a**4 + (a**3)*b + (a**2)*(b**2) + a*(b**3) + b**4
		if num == l[-i-1]:
			print(a,b)
			
			break
		if b == 10**3:
			break
		
		a += 1
		b += 1

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

m = 220
for i in range(1, m):
    for j in range(-m, m):
        if i**5 - j**5 == x:
            print('{0} {1}'.format(i, j))
            exit()

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

Solution (Python):
def solve(x):
  if x == 1:
    print(1, 0)
    return
  if x == 2:
    print(1, -1)
    return
  for d in range(1, x):
    
    if d**2 > x:
      break
    if x % d:
      continue
    for a in range((d+1)//2, x):
      
      t = a**5 + (d - a)**5
      if t == x:
        print(a, a-d)
        return
      if t > x:
        break
                

X = int(input())
solve(X)

Solution (Python):

import math


def check(x, y):
    
    
    
    
    for i in range(x):
        a = x - i
        b = i
        if a ** 4 + a ** 3 * b + a ** 2 * b ** 2 + a * b ** 3 + b ** 4 == y:
            print(a, b)
            exit()


X = int(input())






for b in range(-2*math.ceil(X ** 0.2) - 3, math.ceil(X ** 0.2) + 3):
    sig = 1
    if b ** 5 + X < 0:
        sig = -1
    a = sig * int(abs(b ** 5 + X) ** 0.2)
    if a**5 - b**5 == X:
        print(int(a), b)
        exit()

raise

Solution (Python):
x = int(input())
for i in range(-10**5, 10**5):
    if (x + i**5) < 0:
        continue
    
    
    
    else:
        A_tmp = (x + i**5)**(1.0/5)
        
        
        
        if int(A_tmp)**5 == (x + i**5):
            A = int(A_tmp)
            B = i
            
            
            break
print(str(A) + ' ' + str(B))

Solution (Python):
import math

x = int(input())

a = 0
b = 0
while b**5 > -x:
    b -= 1

while a**5-b**5 != x:
    if a**5-b**5 < x:
        a += 1
    else:
        b += 1
        
print(a, b)

Solution (Python):
d = {}
for i in range(-1000,1000):
	temp = i**5
	if temp not in d:
		d[temp] = i

posd = {}
for i in range(0,1000):
	temp = i**5
	if temp not in posd:
		posd[temp] = i

x = int(input())
for i in posd:
	if i-x in d:
		print(posd[i],d[i-x])
		break

Solution (Python):
X = int(input())
n = 1
while(X > n**5):
    n += 1


for i in range(1,n+1):
    for j in range(0,i+1):
        test = i**5+j**5
        if(X == test):
            print(i,-j)
            exit()

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

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

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

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

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

num_list = tuple(x**5 for x in range(10**4+1))
for i, a in enumerate(num_list):
    for j, b in enumerate(num_list):
        if a-b == X:
            print(i, j)
            exit(0)
        elif a+b == X:
            print(i, -j)
            exit(0)

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

MAX = pow(10,4)

for b in range(-MAX,MAX):
  
  temp = X+pow(b,5) 
  if temp < 0:
    continue
  aa = pow(temp,1/5)
  a = round(aa,5)
  
  if a.is_integer():
    print(int(a),int(b))
    sys.exit()

Solution (Python):
import sys

x = int(input())
n = 1
a = 0
b = 0


def chk(x, a, b):
    if a * a * a * a * a - b * b * b * b * b == x:
        print(a, b)
        sys.exit()


def r(x, n, a, b):
    for _ in range(n):
        a = a + 1
        
        chk(x, a, b)
    return a, b


def u(x, n, a, b):
    for _ in range(n):
        b = b + 1
        
        chk(x, a, b)
    return a, b


def l(x, n, a, b):
    for _ in range(n):
        a = a - 1
        
        chk(x, a, b)
    return a, b


def d(x, n, a, b):
    for _ in range(n):
        b = b - 1
        
        chk(x, a, b)
    return a, b


while n < 100000000:
    a, b = r(x, n, a, b)
    a, b = u(x, n, a, b)
    n = n + 1
    a, b = l(x, n, a, b)
    a, b = d(x, n, a, b)
    n = n + 1

Solution (Python):
x = int(input())
a = 10
f = False
for i in range(-1000, 1001):
  for j in range(-1000,1001):
    if pow(i, 5) - pow(j,5) == x:
      print(i, j)
      f = True
      break
  if f:
    break

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

lower_limit, upper_limit = -10**3, 10**3

for a in range(lower_limit, upper_limit):
    for b in range(lower_limit, upper_limit):
        d = a ** 5 - x
        if d == b ** 5:
            print("{} {}".format(a, b))
            exit(0)

Solution (Python):
num = [i**5 for i in range(-121, 121)]
X = int(input())
for i in range(len(num)):
    a = num[i]
    for j in range(i+1):
        if a - num[j] == X:
            print(i-121, j-121)
            exit()