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


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


def main():
    ans = solve()
    print(*ans)


if __name__ == "__main__":
    main()

Solution (Python):

import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))


X = ir()

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

U = 5 * 10 ** 6
div = make_divisors(X)
for b in range(U):
    for d in div:        
        a = b + d
        if a ** 5 - b ** 5 == X:
            print(a, b)
            exit()
        a = b - d
        if b ** 5 - a ** 5 == X:
            print(b, a)
            exit()

Solution (Python):

"""
Created on Sun May  3 20:56:48 2020
"""

import sys


sys.setrecursionlimit(10 ** 9)


mod = 10**9+7

X = int(input())

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

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

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

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

i = -1000;j = -1000
def siki(a,b):
    return a**5 - b**5
while True:
    if siki(i,j) < x:
        i += 1
        continue
    elif siki(i,j) > x:
        j += 1
        continue
    else:break
print(i,j)

Solution (Python):
import sys
x = int(input())
result = [1,1]
for i in range(-1000,1000):
    for j in range(-1000,1000):
        if x == pow(i, 5)-pow(j, 5):
            result = [i, j]
            print(*result)
            sys.exit()
print(*result)

Solution (Python):
def main():
    X = int(input())
    l = [pow(i, 5, 10**20) for i in range(1000)]
    for vi, i in enumerate(l):
        for vj, j in enumerate(l):
            if i + j == X:
                print(vi, -vj)
                return
            elif i - j == X:
                print(vi, vj)
                return
            elif j - i == X:
                print(-vi, -vj)
                return
main()

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

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

Solution (Python):
def main():
    import sys
    sys.setrecursionlimit(10**6)
    input = sys.stdin.readline
    X = int(input())
    for a in range(-100, 1001):
        for b in range(-1000, 1001):
            if a ** 5 - b ** 5 == X:
                print(a, b)
                exit()


if __name__ == '__main__':
    main()

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

while True:
  t=a**5-b**5
  if t==x:
    break
  if t>x:
    b+=1
  else:
    a+=1
print(a,b)

Solution (Python):
X = int(input())
fork = 1
Done = False
while not Done:
    for A in range(-fork, fork+1):
        for B in range(-fork, fork+1):
            if A**5 - B**5 == X:
                Done = True
                break
            
        if Done:
            break
    fork += 1
print(A, B)

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

memo = []
A = -1
while True:
    A += 1
    A5 = A ** 5
    memo.append(A5)
    if A5 > X:
        try:
            i = memo.index(A5 - X)
        except ValueError:
            continue
        else:
            B = i
            break
    else:
        try:
            i = memo.index(X - A5)
        except ValueError:
            continue
        else:
            B = -i
            break

print(A, B)

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):
import bisect
import copy
import heapq
import math
import sys
from collections import *
from itertools import accumulate, combinations, permutations, product
from math import gcd
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

x=int(input())
lst=[]
for i in range(1000):
    lst.append(i**5)

for i in range(len(lst)):
    for j in range(i,len(lst)):
        if lst[i]+lst[j]==x:
            print(j,-i)
            quit()
        if -lst[i]+lst[j]==x:
            print(j,i)
            quit()
        if lst[i]-lst[j]==x:
            print(-j,i)
            quit()

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

i = 0
tmp = []
for i in range(10 ** 5):
    tmp.append([i ** 5, i])
    tmp.append([(-i) ** 5, -i])
    i += 1

tmp.sort()

tmpset = set([t[0] for t in tmp])

for i in range(len(tmp)):
    if x + tmp[i][0] in tmpset:
        break

b = tmp[i][1]
a5 = x + tmp[i][0]

for j in range(len(tmp)):
    if tmp[j][0] == a5:
        break

a = tmp[j][1]

print(a, b)

Solution (Python):
def main(d):
    t=0
    for i in range(-10**3,10**3):
        if t==0:
            for j in range(-10**3,10**3):
                if i**5-j**5==d:
                    print(i,j)
                    t+=1
                    break
d=int(input())
main(d)

Solution (Python):
X = int(input())
mem = dict()
i = 0
while True :
    a = pow(i, 5)
    if X == a*2 :
        print(-i, i)
        break
    if a in mem :
        print ( i, mem[a] )
        break

    mem[X-a] = -i
    mem[X+a] = i
    
    i += 1

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

Solution (Python):
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush, nlargest, nsmallest
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction



mod = pow(10, 9) + 7
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(*var, end="\n"): sys.stdout.write(" ".join(map(str, var))+end)
def l(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]


dp = dd(int)
for i in range(501):
    dp[i] = pow(i, 5)
    dp[-i] = pow(-i, 5)
n = int(data())
for i in dp.keys():
    for j in dp.keys():
        if dp[i] - dp[j] == n:
            out(i, j)
            exit()

Solution (Python):
from itertools import combinations
x = int(input())
s = []
tov = dict()
for i in range(1000):
    s.append(i**5)
    tov[i**5] = i
    s.append(-i**5)
    tov[-i**5] = -i
for a, b in combinations(s, 2):
    if a - b == x:
        print(tov[a], tov[b])
        break
    elif b - a == x:
        print(tov[b], tov[a])
        break

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

ansa = 0
ansb = 0
for a in range(500):
    for b in range(-500,500):
        if a**5 - b**5 == x:
            ansa=a
            ansb=b
            break

print(ansa,ansb)

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

five_pows = []
for i in range(1000):
    five_pows.append(i**5)

flag = 0
for i in range(1000):
    if flag:
        break
    for j in range(i, 1000):
        if five_pows[j] - five_pows[i] == x:
            flag = 1
            print(j, i)
            break
        elif five_pows[j] + five_pows[i] == x:
            flag = 1
            print(j, -i)
            break

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

Solution (Python):
import sys

stdin = sys.stdin
inf = 1 << 60
mod = 1000000007

ni      = lambda: int(ns())
nin     = lambda y: [ni() for _ in range(y)]
na      = lambda: list(map(int, stdin.readline().split()))
nan     = lambda y: [na() for _ in range(y)]
nf      = lambda: float(ns())
nfn     = lambda y: [nf() for _ in range(y)]
nfa     = lambda: list(map(float, stdin.readline().split()))
nfan    = lambda y: [nfa() for _ in range(y)]
ns      = lambda: stdin.readline().rstrip()
nsn     = lambda y: [ns() for _ in range(y)]
ncl     = lambda y: [list(ns()) for _ in range(y)]
nas     = lambda: stdin.readline().split()

x = ni()
def sol():
    for i in range(-200, 200):
        for j in range(-200, 200):
            if (i ** 5) - (j ** 5) == x:
                print(i, j)
                return

sol()

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

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

for i in range(-500,501):
    for j in range(-500,501):
        a=i
        b=j
        val=a**5-b**5
        if val==X:
            print(a,b)
            exit()

Solution (Python):
t =1

for _ in range(t):
    
    n = int(input())
    f=0
    
    for i in range(-1000,1001):
        for j in range(-1000,1001):
            if((i**5 - j**5) == n):
                print(i,j)
                f=1
                break
        if(f==1):
            break

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

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

Solution (Python):
x=int(input())
for i in range(1,400000):
  a=i
  b=int(abs((a**5-x)**0.2))
  for j in range(-1,2):
    if (b+j)**5==a**5-x:
      print(a,b)
      quit()
    if (-b+j)**5==a**5-x:
      print(a,-b)
      quit()

Solution (Python):
import sys
sys.setrecursionlimit(700000)

def s_in():
    return input()

def n_in():
    return int(input())

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

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


x = n_in()

for a in range(-1000,1001):
    for b in range(-1000,1001):
        if x==h(a,b):
            print(a,b)
            exit()

print(-1)

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

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

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

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


def iroot(x, n):
    lo, hi = 0, x
    while lo <= hi:
        mi = (lo + hi) // 2
        if pow(mi, n) > x:
            hi = mi - 1
        elif pow(mi, n) < x:
            lo = mi + 1
        else:
            return (mi, True)
    return (None, False)


for b in range(X + 1):
    A, f = iroot(X + pow(b, 5), 5)
    if f:
        print(A, b)
        break
    A, f = iroot(X - pow(b, 5), 5)
    if f:
        print(A, -b)
        break

Solution (Python):
X = int(input())
for A in range(-1000,1001):
    for B in range(-1000,1001):
        if A**5-B**5 == X:
            print(A,B)
            break
    else:
        continue
    break

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

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

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

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

def solve(X):
    fac = divisor(X)
    for f in fac:
        for i in range(1,10**4):
            A = i
            B = i-f
            p = i**5-B**5
            if p==X:
                break
        else:
            continue
        break
    ans = [A,B]
    return ans
print(*solve(X),sep=' ')

Solution (Python):
def mp():return map(int,input().split())
def lmp():return list(map(int,input().split()))

x = int(input())
num = []
for i in range(1000):
    num.append(i)
    num.append(-i)
for i in range(len(num)):
    for j in range(len(num)):
        if num[i]**5 - num[j]**5 == x:
            print(num[i],num[j])
            exit()

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

Solution (Python):
X = int(input())
for i in range(-10**3,10**3+1):
  flag = False
  for j in range(i+1,10**3+1):
    if j**5-i**5==X:
      print(j,i)
      flag = True
      break
  
  if flag:
    break

Solution (Python):
from sys import exit

x=int(input())
for i in range(0,201):
	for j in range(-200,i):
		if i**5-j**5==x:
			print(i,j)
			exit()

Solution (Python):

from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")


def solve():
    x = II()
    for i in range(-int(x ** 0.2)*2 - 1, int(x ** 0.2) + 1):
        for j in range(-int(x ** 0.2) * 2 - 1, int(x ** 0.2) * 2 + 1):
            if i ** 5 - j ** 5 == x:
                print(i , j)
                return
    return



if __name__ == '__main__':
    solve()

Solution (Python):
X = int(input())
fif = [i**5 for i in range(200)]
for i in range(len(fif)):
    B5 = fif[i] - X
    if abs(B5) in fif:
        index = fif.index(abs(B5))
        B = B5//abs(B5) * index
        break

print(i, B)

Solution (Python):
import numpy as np
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    x=INT()
    flg=0
    for i in range(1,201):
        if x%i==0:
            temp=int(x/i)
            
            for k in range(201):
                a=k
                b=a-i
                ans=a**4+(a**3)*b+(a**2)*(b**2)+a*(b**3)+b**4
                if temp==ans:
                    print(a,b)
                    flg=1
                    break
        if flg==1:
            break
                    
                
if __name__ == '__main__':
    do()

Solution (Python):
X = int(input())
L = [i ** 5 for i in range(0, 500)]
for i in L:
    for j in L:
        if i + j == X:
            print(int(i**0.2), -int(j**0.2))
            exit()
        if i - j == X:
            print(int(i**0.2), int(j**0.2))
            exit()
        if -i + j == X:
            print(-int(i**0.2), -int(j**0.2))
            exit()
        if -i - j == X:
            print(-int(i**0.2), int(j**0.2))
            exit()

Solution (Python):

X=int(input())

for a in range(1500):
    for b in range(1500):
        A=a-1000
        B=b-1000
        if A**5 - B**5 ==X:
            ans1=A
            ans2=B


print(ans1,ans2)

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

from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
from collections import deque, defaultdict
from itertools import combinations, permutations, combinations_with_replacement
from itertools import accumulate
from math import ceil, sqrt, pi

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

def solve(X):
    
    for a in range(10000):

        k = a**5 - X
        if k > 0:
            b = round(k**(1/5))
            if a**5 - b**5 == X:
                return a,b
        elif k < 0:
            b = (-k)**(1/5)
            b = round(b)
            if a**5 + b**5 == X:
                return a,-b
    return None

a,b = solve(X)
print(a,b)

Solution (Python):
X = int(input())
flg = False
for a in range(3*10**3):
    if flg:
        break
    for b in range(-3*10**3,a):
        if a**5-b**5==X:
            print(a,b)
            flg = True
            break

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

Solution (Python):
X = int(input())
for i in range(-5000,5001):
  for k in range(-5000,5001):
    tmp = i**5 - k**5
    if(tmp == X):
      print(i,k)
      exit()
    else:
      pass

Solution (Python):
x = int(input())
if x == 0:
    print("1 1")
    exit(0)

i = 1
while True:
    for a in range(-i, i + 1):
        b = i
        if a ** 5 - b ** 5 == x:
            print("{} {}".format(a, b))
            exit(0)
    
        b = -i
        if a ** 5 - b ** 5 == x:
            print("{} {}".format(a, b))
            exit(0)
    
    for b in range(-i, i + 1):
        a = i
        if a ** 5 - b ** 5 == x:
            print("{} {}".format(a, b))
            exit(0)
    
        a = -i
        if a ** 5 - b ** 5 == x:
            print("{} {}".format(a, b))
            exit(0)
    
    i += 1

Solution (Python):
x = int(input())
p5 = [i ** 5 for i in range(121)]

a = 0
b = 0

for _p5 in p5:
  if _p5 + x in p5:
    a = p5.index(_p5 + x)
    b = p5.index(_p5)
    break
  
  if x - _p5 in p5:
    a = p5.index(x - _p5)
    b = -(p5.index(_p5))
    break

print(str(a) + " " + str(b))

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

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

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)

    return divisors


x = int(input())

d = make_divisors(x)

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

Solution (Python):
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): 
    return list(map(int,input().split()))
def m(): 
    return map(int,input().split())
def onem(): 
    return int(input())
def s(x): 
    a = []
    if len(x) == 0:
        return []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): 
    return " ".join(map(str,x))
def max2(x): 
    return max(map(max,x))
def In(x,a): 
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

def pow_k(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans

"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

x = onem()

po = [0,1]

for i in range(1,10**3+1):
    po.append((i+1)**5)

a,b = 0,0
for i in range(10**3+2):
    for j in range(10**3+2):
        if po[i] - po[j] == x:
            a = i
            b = j
            break
        elif po[i] + po[j] == x:
            a = i
            b = -j
            break
    else:
        continue
    break

print(a,b)

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

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

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

d5=[0]*(10001)
for i in range(10001):
    d5[i]=i**5


for i in range(10001):
    for j in range(10001):
        ans1=d5[i]-d5[j]
        if ans1==X:
            print(i,j)
            exit()
        ans2=d5[i]+d5[j]
        if ans2==X:
            print(i,(-1)*j)
            exit()

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

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

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

Solution (Python):
x=int(input())
flag=False
i=-1000
while i<1000 and flag==False:
    j=-1000
    while j<1000 and flag==False:
        if i**5-j**5==x:
            flag=True
            print(i,j)
            break
        j+=1
    i+=1

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

for a in range(-200, 201):
    t = a ** 5
    for b in range(-200, 201):
        if t - (b ** 5) == x:
            print('{} {}'.format(a, b))
            exit()

Solution (Python):
X=int(input())
for a in range(201):
 for b in range(401):
  if a**5-(b-200)**5==X:
   x=str(a)
   y=str(b-200)
L=[x,y]
L=' '.join(L)
print(L)

Solution (Python):

MOD = 10 ** 9 + 7
RLIMIT = 1000
DEBUG = 1

def main():
    for _ in inputt(1):
        x, = inputi()
        D = {0: 0}
        for i in count(1):
            d = i ** 5
            debug(i, d, x - d)
            if x - d in D:
                print(i, D[x - d])
                break
            D[d] = -i
            D[-d] = i









from math import *
from heapq import *
from itertools import *
from functools import reduce, lru_cache, partial
from collections import Counter, defaultdict
import re, copy, operator, cmath
import sys, io, os, builtins
sys.setrecursionlimit(RLIMIT)





BUFSIZE = 8192
class FastIO(io.IOBase):
    newlines = 0
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = io.BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
class IOWrapper(io.IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
def print(*args, **kwargs):
    if args:
        sys.stdout.write(str(args[0]))
        split = kwargs.pop("split", " ")
        for arg in args[1:]:
            sys.stdout.write(split)
            sys.stdout.write(str(arg))
    sys.stdout.write(kwargs.pop("end", "\n"))
def debug(*args, **kwargs):
    if DEBUG and not __debug__:
        print("debug", *args, **kwargs)
        sys.stdout.flush()
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip()
inputt = lambda t = 0: range(t) if t else range(int(input()))
inputs = lambda: input().split()
inputi = lambda k = int: map(k, inputs())
inputl = lambda t = 0, k = lambda: list(inputi()): [k() for _ in range(t)] if t else list(k())





def len(a):
    if isinstance(a, range):
        return -((a.start - a.stop) // a.step)
    return builtins.len(a)
def bisect_left(a, x, key = None, lo = 0, hi = None):
    if lo < 0: lo = 0
    if hi == None: hi = len(a)
    if key == None: key = do_nothing
    while lo < hi:
        mid = (lo + hi) // 2
        if key(a[mid]) < x: lo = mid + 1
        else: hi = mid
    return lo
def bisect_right(a, x, key = None, lo = 0, hi = None):
    if lo < 0: lo = 0
    if hi == None: hi = len(a)
    if key == None: key = do_nothing
    while lo < hi:
        mid = (lo + hi) // 2
        if x < key(a[mid]): hi = mid
        else: lo = mid + 1
    return lo
def insort_left(a, x, key = None, lo = 0, hi = None):
    lo = bisect_left(a, x, key, lo, hi)
    a.insert(lo, x)
def insort_right(a, x, key = None, lo = 0, hi = None):
    lo = bisect_right(a, x, key, lo, hi)
    a.insert(lo, x)
do_nothing = lambda x: x
bisect = bisect_right
insort = insort_right
def index(a, x, default = None, key = None, lo = 0, hi = None):
    if lo < 0: lo = 0
    if hi == None: hi = len(a)
    if key == None: key = do_nothing
    i = bisect_left(a, x, key, lo, hi)
    if lo <= i < hi and key(a[i]) == x: return a[i]
    if default != None: return default
    raise ValueError
def find_lt(a, x, default = None, key = None, lo = 0, hi = None):
    if lo < 0: lo = 0
    if hi == None: hi = len(a)
    i = bisect_left(a, x, key, lo, hi)
    if lo < i <= hi: return a[i - 1]
    if default != None: return default
    raise ValueError
def find_le(a, x, default = None, key = None, lo = 0, hi = None):
    if lo < 0: lo = 0
    if hi == None: hi = len(a)
    i = bisect_right(a, x, key, lo, hi)
    if lo < i <= hi: return a[i - 1]
    if default != None: return default
    raise ValueError
def find_gt(a, x, default = None, key = None, lo = 0, hi = None):
    if lo < 0: lo = 0
    if hi == None: hi = len(a)
    i = bisect_right(a, x, key, lo, hi)
    if lo <= i < hi: return a[i]
    if default != None: return default
    raise ValueError
def find_ge(a, x, default = None, key = None, lo = 0, hi = None):
    if lo < 0: lo = 0
    if hi == None: hi = len(a)
    i = bisect_left(a, x, key, lo, hi)
    if lo <= i < hi: return a[i]
    if default != None: return default
    raise ValueError






class Tree:
    def __init__(n):
        self._n = n
        self._conn = [[] for _ in range(n)]
        self._list = [0] * n
    def connect(a, b):
        pass





class Sieve:
    def __init__(self):
        self._n = 6
        self._list = [2, 3, 5, 7, 11, 13]
    def extend(self, n):
        if n <= self._list[-1]: return
        maxbase = int(n ** 0.5) + 1
        self.extend(maxbase)
        begin = self._list[-1] + 1
        newsieve = [i for i in range(begin, n + 1)]
        for p in self.primerange(2, maxbase):
            for i in range(-begin % p, len(newsieve), p):
                newsieve[i] = 0
        self._list.extend([x for x in newsieve if x])
    def extend_to_no(self, i):
        while len(self._list) < i: 
            self.extend(int(self._list[-1] * 1.5))
    def primerange(self, a, b):
        a = max(2, a)
        if a >= b: return
        self.extend(b)
        i = self.search(a)[1]
        maxi = len(self._list) + 1
        while i < maxi:
            p = self._list[i - 1]
            if p < b:
                yield p
                i += 1
            else: return
    def search(self, n):
        if n < 2: raise ValueError
        if n > self._list[-1]: self.extend(n)
        b = bisect(self._list, n)
        if self._list[b - 1] == n: return b, b
        else: return b, b + 1
    def __contains__(self, n):
        if n < 2: raise ValueError
        if not n % 2: return n == 2
        a, b = self.search(n)
        return a == b
    def __getitem__(self, n):
        if isinstance(n, slice):
            self.extend_to_no(n.stop + 1)
            return self._list[n.start: n.stop: n.step]
        else:
            self.extend_to_no(n + 1)
            return self._list[n]
sieve = Sieve()
def isprime(n):
    if n <= sieve._list[-1]:
        return n in sieve
    for i in sieve:
        if not n % i: return False
        if n < i * i: return True
prime = sieve.__getitem__
primerange = lambda a, b = 0: sieve.primerange(a, b) if b else sieve.primerange(2, a)
def factorint(n):
    factors = []
    for i in sieve:
        if n < i * i: break
        while not n % i:
            factors.append(i)
            n //= i
    if n != 1: factors.append(n)
    return factors
factordict = lambda n: Counter(factorint(n))





if __name__ == "__main__":
    main()

Solution (Python):
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0

g = int(readline())

def pow(n,p): 
    res = 1
    while p > 0:
        if p % 2 == 0:
            n = n ** 2
            p //= 2
        else:
            res = res * n
            p -= 1
    return res

for i in range(200):
    for j in range(200):
        k = pow(i,5)
        l = pow(j,5)
        if k-l == g:
            print(i,j)
            exit()
        elif k+l == g:
            print(i,-j)
            exit()

Solution (Python):
def divisor(n):
    ass = []
    for i in range(1,int(n**0.5)+1):
        if n%i == 0:
            ass.append(i)
            if i**2 == n:
                continue
            ass.append(n//i)
    return ass


x = int(input())
d_l = divisor(x)

for d in d_l:
    for b in range(-1004,1004):
        if (b+d)**5 - b**5 == x:
            print(b+d,b)
            exit()
        if (b-d)**5 - b**5 == x:
            print(b-d,b)
            exit()

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

for i in range(1000):
    for j in range(1000):
        a = i**5
        b = j**5
        if a-b == x:
            print(i,j)
            exit()
        elif a+b == x:
            print(i,-j)
            exit()
        elif -a-b == x:
            print(-i,-j)
            exit()

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