Problem:
 Score : 400 points    Problem Statement Give a pair of integers (A, B) such that A^5-B^5 = X .
It is guaranteed that there exists such a pair for the given integer X .      Constraints  1 \leq X \leq 10^9  X is an integer.  There exists a pair of integers (A, B) satisfying the condition in Problem Statement.         Input Input is given from Standard Input in the following format:  X       Output Print A and B , with space in between.
If there are multiple pairs of integers (A, B) satisfying the condition, you may print any of them.  A  B         Sample Input 1 33      Sample Output 1 2 -1  For A=2 and B=-1 , A^5-B^5 = 33 .       Sample Input 2 1      Sample Output 2 0 -1

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

Solution (Python):


def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    import math
    

    
    

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


if __name__ == '__main__':
    main()

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

Solution (Python):
def main():
    x = int(input())
    n = int(pow(x,0.2))
    m = int(pow(x,0.25))

    ans = (0,0)

    for a in range(n+1):
        for b in range(n+1):
            if a**5 + b**5 == x:
                ans = (a,-b)

    for a in range(m+1):
        for b in range(m+1):
            if a**5 - b**5 == x:
                ans = (a,b)
    
    print(ans[0],ans[1])
main()

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7


x=I()
five=[i**5 for i in range(200)]
plus=[]
minus=[]
for i in range(200):
    for j in range(i,200):
        plus.append([five[i]+five[j],j,i])
        minus.append([five[j]-five[i],j,i])


for u in plus:
    if x==u[0]:
        print(u[1],end=" ")
        print(-u[2])
        sys.exit()
for u in minus:
    if x==u[0]:
        print(u[1],end=" ")
        print(u[2])
        sys.exit()

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

def func(num):
    cand=[]
    for b in range(-500,501):
        a=b+num
        temp=a**4+a**3*b+a**2*b**2+a*b**3+b**4
        cand.append(temp)
    return cand

yaku=[]

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

for item in yaku:
    lis=func(item)
    for i in range(len(lis)):
        if lis[i]*item==X:
            i-=500
            print(i+item,i)
            exit()

Solution (Python):


import itertools


L = 10 ** 16
SIGNS = [(1, 1), (1, -1), (-1, 1), (-1, -1)]


def enum_fifth_powers(limit=None):
    if limit is None:
        limit = L
    res = []
    for i in itertools.count():
        i5 = i * i * i * i * i
        if i5 > limit:
            return res
        else:
            res.append(i5)


def solve(x):
    pow_table = enum_fifth_powers()
    for sa, sb in SIGNS:
        for (a, a5), (b, b5) in itertools.product(enumerate(pow_table), repeat=2):
            if sa * a5 - sb * b5 == x:
                return sa * a, sb * b


def test():
    vs = enum_fifth_powers()
    
    print(len(vs))


def main():
    x = int(input())
    print(*solve(x))


if __name__ == "__main__":
    main()

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

d = 1
while d * d <= x:
	if (x % d) == 0:
		for b in range(-200, 200):
			a = b + d
			if a**4 + a**3 * b + a**2 * b**2 + a * b**3 + b**4 == x // d:
				print(a, b)
				exit(0)
	d += 1

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 6)

def main():
    X = int(input())
    T = [i**5 for i in range(-1000, 1000)]
    for ai, a in enumerate(T):
        for bi, b in enumerate(T):
            if a - b == X:
                print(ai-1000, bi-1000)
                return

if __name__ == '__main__':
    main()

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

for i in range(100):
    for j in range(100):
        if i ** 5 + j ** 5 == X:
            print(i, -j)
            exit()
            
        if i ** 5 + j ** 5 > X:
            continue

for i in range(2000):
    for j in range(2000):
        if j ** 5 - i ** 5 == X:
            print(j, i)
            exit()
            
        if j ** 5 - i ** 5 > X:
            continue

Solution (Python):
from itertools import combinations

x = int(input())
num = [i**5 for i in range(1000)]

for a, b in combinations(num, 2):
    if a - b == x:
        print(int(a**0.2), int(b**0.2))
    elif a + b == x:
        print(int(a**0.2), -int(b**0.2))
    elif b - a == x:
        print(int(b**0.2), int(a**0.2))
    elif b + a == x:
        print(int(b**0.2), -int(a**0.2))
    else:
        continue
    break

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

Solution (Python):
import sys
input=lambda: sys.stdin.readline().rstrip()
x=int(input())
A=[int(i) for i in range(5000)]
Ans=[]
for a in A:
  for b in A:
    if a**5+b**5==x and not Ans:
      Ans=[a,-b]
    if a**5-b**5==x and not Ans:
      Ans=[a,b]
print(*Ans)

Solution (Python):
x = int(input())
c = 0
for a in range(500):
    for b in range(-500, 500):
        if a**5-b**5 == x:
            print(a, b)
            c = 1
            break;
    if c == 1:
        break;

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

Solution (Python):
inpl = lambda: list(map(int,input().split()))
from math import sqrt, ceil
def divisors(n, sort=True, reverse=False):
    sqn = int(ceil(sqrt(n)))
    div_list = []
    if sqn*sqn == n:
        div_list.append(sqn)
    for i in range(1,sqn):
        if n % i == 0:
            div_list.append(i)
            div_list.append(n//i)
    if sort:
        div_list.sort(reverse=reverse)
    return div_list

X = int(input())
divs = divisors(X)
for y in divs:
    a, b = y, 0
    while a**5 - b**5 < X:
        a += 1
        b += 1
    if a**5 - b**5 == X:
        print(a, b)
        exit()
    
    for b in range(1, y//2 + 1):
        a = y - b
        if a**5 + b**5 == X:
            print(a, -b)
            exit()

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


a,b = 0,0
for i in range(1000):
    u = i**5
    if u <= x:
        for j in range(1000):
            v = j**5
            if u + v > x:
                break
            elif u + v == x:
                a,b = i,-j
    elif u == x:
        a,b = i,0
    else:
        for j in range(i):
            v = j**5
            if u-v < x:
                break
            elif u-v == x:
                a,b = i,j
print(a,b)

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





















X = int(input())
x = X**(0.2)
x = int(x)
x = max(x,1)
flag = 0
for A in range(1,10*x):
    if flag == 1:
        break
    for B in range(-10*x,A+1):
        if A ** 5 - B ** 5 == X:
            print(A,B)
            flag = 1
            break

Solution (Python):

MOD = 10 ** 9 + 7
INFI = 10**10

import math

import itertools
import heapq


import copy
from functools import lru_cache

def sosuhante(n):
    for k in range(2, int(math.sqrt(n))+1):
        if n% k ==0:
            return False
    return True
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def kingaku(a,b,n):
    keta=len(str(n))
    return a*n+b*keta

def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default




def ret(a):
    c=[None]*(len(a)-1)
    if len(a)==1:
        return a[0]
    elif len(a)==0:
        return 0
    for i in range(1,len(a)):
        c[i-1]=abs(a[i]-a[i-1])
    return ret(c)


def main():
    x=int(input())
    ans=[0,0]
    m=-500
    M=-m
    for i in range(m,M):
        for j in range(m,M):
            if j**5-i**5==x:
                ans=[j,i]
                break
    print(*ans)






if __name__ == "__main__":

    main()

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

d = {}
k = {}
for i in range(-1000,1001):
    d[i] = pow(i,5)
    k[d[i]] = i
i = 1000

while True:
    if X + d[i] in d.values():
        b = i
        a = k[X + d[i]]
        break
    i -= 1

print(a, b)

Solution (Python):
x = int(input())
a = []
b = []
c = []
for i in range(200):
    a.append(i**5)
    b.append(i**5)
    a.append((-i)**5)
    b.append((-i)**5)
    c.append(i)
    c.append(-i)

ans_1=0
for i in range(len(a)):
    for j in range(len(b)):
        if a[i] - b[j] == x:
            ans_1 = c[i]
            ans_2 = c[j]
            break
    if ans_1 != 0:
        break
print(str(ans_1) + ' ' + str(ans_2))

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

Solution (Python):
def main():
    X = int(input())
    A = 1
    B = 0
    while A <= 10**9:
        for B in range(A-1, A*(-1)-1, -1):    
            x = A ** 5 - B ** 5
            if x == X:
                print(A, B, sep=" ")
                return
            elif x > X:
                break
        
        A += 1

if __name__ == "__main__":
    main()

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

for i in range(10**3+1):
    for j in range(2*10**3+2):
        if i**5-(j-1000)**5 == x:
            print(i,j-1000)
            flag =True
            break
    if flag:
        break

Solution (Python):

import sys
import math
import itertools
import collections


def solve(X):
    l = [i for i in range(-1000,1000,1)]
    
    
    for A in range(1000):
        for B in range(-1000,1000,1):
            if(X == (A**5 - B**5)):
                print(A,B)
                sys.exit()
def main():
    X = int(input())
    solve(X)
    

if __name__ == "__main__":
    main()

Solution (Python):


X=int(input())

S=[0]*200

A=0
B=0
for i in range(200):
    S[i]=i**5

for i in range(200):
    for j in range(200):
        if S[i] + S[j] == X:
            A=i
            B=-j 
            break
        if S[i] - S[j] == X:
            A=i
            B=j
            break

print("{} {}".format(A,B))

Solution (Python):



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

x=int(input())

def make_divisor(x):
    pass

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 sorted(ass) 
    
k=(divisor(x))


def f(a,b):
    return a**4+a**3*b+a**2*b**2+a*b**3+b**4
for i in k:
    
    for a in range(0,int(x**0.5)+1):
        b=a-i
        
        
        if x//i==f(a,b):
            print(a,b)
            exit()

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

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

a=[0]
for i in range(1,201):
    a.append(i**5)

I=0
J=0
b=0
for i in range(0,201):
    for j in range(0,201):
        if a[i]-a[j]==x:
            I=i
            J=j
            b=1
            break
    if b==1:
        break

for i in range(0,201):
    for j in range(0,201):
        if a[i]+a[j]==x:
            I=i
            J=-j
            b=1
            break
    if b==1:
        break
print(I,J)

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

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

Solution (Python):

from collections import deque, defaultdict
from itertools import combinations, combinations_with_replacement
import bisect
from math import factorial, sqrt, log, ceil, floor

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

    d = {}
    for a in range(LARGE):
        d[a**5] = a

    for a in range(LARGE):
        A = a ** 5
        remain = A - X
        abs_remain = abs(remain)
        if abs_remain in d:
            b = d[abs_remain]
            if remain < 0:
                b = -b
            break

    print("{} {}".format(a, b))


if __name__ == '__main__':
    main()

Solution (Python):
x=int(input())
A=0
B=0
for i in range(1000):
  for j in range(i+1):
    a=pow(i,5)
    b=pow(j,5)
    if a-b==x:
      A=i
      B=j
for i in range(80):
  for j in range(80):
    a=pow(i,5)
    b=pow(j,5)
    if a+b==x:
      A=i
      B=-j
print(A,B)

Solution (Python):
X=int(input())
A=0
while True:
    B=0
    while A**5-B**5>=X:
        if A**5-B**5==X:
            print(A,B)
            exit()
        B+=1
    while A**5-B**5<=X:
        if A**5-B**5==X:
            print(A,B)
            exit()
        B-=1
    A+=1

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

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

Solution (Python):
import sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = 10**20
def I(): return int(input())
def F(): return float(input())
def S(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()

def resolve():
    X = I()

    i = 0
    while i**5<X:
        i += 1
    
    B = -(i-1)
    while True:
        A = int((B**5+X)**0.2)
        if A**5==B**5+X:
            break
        B += 1

    print(A, B)

if __name__ == '__main__':
    resolve()

Solution (Python):
if __name__ == '__main__':
    from sys import stdin
    
    
    
    input = stdin.readline


    x = int(input())

    squared = [0]*401
    for i in range(-200, 201):
        squared[i+200] = i**5

    ans_dict = dict()
    
    for i in range(401):
        for j in range(i, 401):
            temp = squared[j]-squared[i]
            ans_dict[temp] = (j-200, i-200)
    a, b = ans_dict[x]
    print(a, b)

Solution (Python):
x = int(input())
i = 0
for i in range(10**9):
    d = i**5 - x
    if d < 0:
        a = -1
    else:
        a = 1
    for j in range(i):
        if a*(j**5) == d:
            print(i, a*j)
            exit()

Solution (Python):
def resolve():
    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)
                return


if __name__ == '__main__':
    resolve()

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

Solution (Python):
x = int(input())
ans = (-1,-1)
gojo = [i**5 for i in range(200)]
for i in range(200):
    for j in range(200):
        if gojo[i]+gojo[j]==x:
            ans = (i,-j)
        if gojo [i]- gojo[j]==x:
            ans = (i,j)
        
print(ans[0],ans[1])

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

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

for a, i in enumerate(lists):
    for b, j in enumerate(lists):
        if X == i - j:
            print(a, b)
            exit()
        elif X == i + j:
            print(a, -b)
            exit()

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

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

a = []
for x in range(-150,150):
    a.append(x**5)
    
    
import itertools

seq = (x for x in range(300))
ptr = list(itertools.combinations(seq,2))

for i in range(len(ptr)):
    tmp = a[ptr[i][0]]-a[ptr[i][1]]
    if abs(tmp) == X:
        if tmp == X:
            A = ptr[i][0] - 150
            B = ptr[i][1] - 150
        else:
            A = ptr[i][1] - 150
            B = ptr[i][0] - 150
            
            
print(A,B)

Solution (Python):
X=int(input())
flg=0
ans=[]
for i in range(-500,500):
	if flg!=0:break
	for j in range(-500,500):
		if i**5-j**5==X:
			ans=[i,j]
			flg=1
		if flg!=0:break
print(str(ans[0])+" "+str(ans[1]))

Solution (Python):
x=int(input())
a=1
while (a)**5-(a-1)**5<x:
  a+=1

import itertools
seq=[i for i in range((-1)*a,a+1)]
lis=list(itertools.permutations(seq, r=2))
now=0
b=0
while now==0:
  if (lis[b][0])**5-(lis[b][1])**5==x:
    print(lis[b][0],lis[b][1])
    now=1
  else:
    b+=1

Solution (Python):
X = int(input())
l = []
for i in range(-1000,1001):
    l.append(i**5)
for i in range(len(l)-1):
    for j in range(i,len(l)):
        if abs(l[i]-l[j]) == X:
            ai = i-1000
            aj = j-1000
            break

print(aj,ai)

Solution (Python):
import sys
import math
from collections import Counter
import itertools
import fractions



def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())

def LI(): return list(map(int, sys.stdin.readline().split()))

def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'


p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")


 

X=II()

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

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

Solution (Python):
def main():
    x = int(input())
    for a in range(10**4):
        a5 = a**5
        tar = a5 - x
        if 0 <= tar:
            L, R = 0, 10**5
            while L+1 < R:
                P = (L+R)//2
                p5 = P**5
                if p5 <= tar:
                    L = P
                else:
                    R = P
            if L**5 == tar:
                print(a, L)
                break
        else:
            L, R = -(10**5), 0
            while L+1 < R:
                P = (L+R)//2
                p5 = P**5
                if p5 <= tar:
                    L = P
                else:
                    R = P
            if L**5 == tar:
                print(a, L)
                break

if __name__ == "__main__":
    main()

Solution (Python):
x=int(input())
ans=[0,0]
t=False
for a in range(1000):
  for b in range(-a,a+1):
    if a**5-b**5==x:
      ans=[a,b]
      t=True
      break
  if t:
    break
print(ans[0],' ',ans[1])

Solution (Python):
X = int(input())
A = 0
B = 0
for i in range(10 ** 3):
    for j in range(- 10 ** 3, 10 ** 3):
        if i ** 5 - j ** 5 == X:
            A = i
            B = j
print(A, B)

Solution (Python):
from itertools import combinations

X = int(input())
for i, j in combinations(range(1000), 2):
    b = i
    a = j
    i = i ** 5
    j = j ** 5
    if j - i == X:
        print(a, b)
        exit()
    if j + i == X:
        print(a, -b)
        exit()

Solution (Python):
def f(y, b):
    return y**4 + 5*(y**3)*b + 10*(y**2)*(b**2) + 10*y*(b**3) + 5*(b**4)

X = int(input())
for y in range(1, int(X**0.5)+1):
    if X%y==0:
        tmp = X//y
        right = int(tmp**(1/4))+1
        left = -right
        while left < right:
            b = (right + left)//2
            fyb = f(y, b)
            if  fyb == tmp:
                break
            elif fyb > tmp:
                right = b
            else:
                left = b + 1
        if fyb == tmp:
            break
print(y+b, b)

Solution (Python):

import sys
import math

def solve(X: int):
    lim = 200

    for A in range(-lim, lim):
        for B in range(-lim, lim):
            x = math.pow(A, 5) - math.pow(B, 5)
            if X == int(x):
                print(A, B)
                return
    return


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

if __name__ == '__main__':
    main()

Solution (Python):

import sys

def main():
    X = int(input())
    N = 2*10**2
    for i in range(N):
        for j in range(i,N):
            tmp = j**5 - i**5
            if tmp == X:
                print(j,i)
                exit()
            elif tmp == X - 2*(i**5):
                print(j,-i)
                exit()

if __name__ == '__main__':
    main()

Solution (Python):
X = int(input())
i = 1
ok = False
while i * i <= X and not ok:
  if X % i == 0:
    for x in (i, X//i):
      A = -10000
      while A <= 10000:
        if A**5-(A-x)**5 == X:
          print(A, A-x)
          ok = True
          break
        A += 1
      if ok:
        break
  i += 1

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

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

for i in range(1000):
    
    
    for j in range(1000):
        
        if i ** 5 - j ** 5 == x:
            print(i, j)
            quit()
        elif i ** 5 - (-j) ** 5 == x:
            print(i, -j)
            quit()
        elif (-i) ** 5 - j ** 5 == x:
            print(-i, j)
            quit()
        elif (-i) ** 5 - (-j) ** 5 == x:
            print(-i, -j)
            quit()

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

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

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())
divs = make_divisors(X)


for p in divs:
    for b in range(-10000, 10000):
        a = b+p
        if a**5 - b**5 == X:
            print(a, b)
            exit()

Solution (Python):
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 

def ii(): return int(sys.stdin.readline().rstrip()) 
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) 
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]

def ss(): return sys.stdin.readline().rstrip() 
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) 
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]





x=ii()

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

Solution (Python):
import sys
K = int(input())
num = [i**5 for i in range(150)]
for i in range(len(num)):
    for j in range(len(num)):
        if num[i] - num[j] == K :
            print(i,j)
            sys.exit()
        elif num[i] + num[j] == K:
            print(i,-j)
            sys.exit()

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

for v in itertools.permutations(range(-300,300),2):
    if (v[0])**5 - (v[1])**5 == x:
        print(v[0], v[1])
        break

Solution (Python):
X = int(input())
A = [a ** 5 for a in range(200)]
for b in range(200):
    B = b ** 5
    if X + B in A:
        print(A.index(X + B), b)
        break
    if X - B in A:
        print(A.index(X - B), -b)
        break

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

v = [0] * 200
mv = [0] * 200
for i in range(200):
    v[i] = i*i*i*i*i
    mv[i] = i*i*i*i*i*(-1)

result_a = 0
result_b = 0
for i in range(200):
    for j in range(200):
        if(v[i] - v[j] == x):
            result_a = i
            result_b = j
        if(v[i] - mv[j] == x):
            result_a = i
            result_b = j*(-1)

print(result_a, result_b)

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


for A in range(120):
    B5=abs(A**5-X)
    Bfugou=A**5>X
    B=B5**0.2
    B=int(B)
    if Bfugou==False:
        B=-B
    if A**5-B**5==X:
        print(A,B)
        break
    A+=1

Solution (Python):

from math import *

mod = (10**9) + 7


def _in():
    return [int(x) for x in input().split(' ')]


def main():
    x = int(input())
    for i in range(-1001, 1001):
        for j in range(-1001, 1001):
            a = pow(i, 5) - pow(j, 5)
            if(a == x):
                print(i, j)
                return


if __name__ == "__main__":
    main()

Solution (Python):
from math import sqrt

x = int(input())

for i in range(-int(sqrt(sqrt(x))), int(sqrt(sqrt(x))) + 1):
    for j in range(-int(sqrt(sqrt(x))), int(sqrt(sqrt(x))) + 1):
        if i ** 5 - j ** 5 == x:
            print(i, j)
            exit()

Solution (Python):
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

x = ii()
dp = [0]*201
for i in range(1,201):
    dp[i] = i**5
from bisect import bisect_left as bl
'''index  =  bl(list,num)'''
for i in range(1,200):
    index = bl(dp,dp[i]+x)
    if index == 201:
        continue
    if dp[index] == dp[i] +x:
        print(index,i)
        exit()

for i in range(1,200):
    index = bl(dp,-dp[i]+x)
    if index == 201:
        continue
    if dp[index] == -dp[i] +x:
        print(index,-i)
        exit()

Solution (Python):
x = int(input())
isLoop = True
for i in range(0, 121):
    a = i ** 5
    for j in range(0, i):
        b = j ** 5
    
        if a - b == x:
            print("{} {}".format(i,j))
            isLoop = False
            break
        elif a + b == x:
            print("{} {}".format(i,-j))
            break
    if isLoop == False:
        break

Solution (Python):
X=int(input())
D={}
D[0]=0
for i in range(1,200001):
    D[i**5]=i
    D[-i**5]=-i

for i in range(-200000,200001):
    if X+i**5 in D:
        print(D[X+i**5],i)
        exit()

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


def f(n):
    return int(math.pow(n, 5))


C = []


lastV = 0

count = 0
while True:
    tmp = f(count)
    C.append(tmp)
    count += 1
    if tmp - lastV > 10 ** 9 + 10:
        break
    lastV = tmp


for j in range(len(C)):
    for i in range(len(C)):
        if C[i] + C[j] == X:
            print(*[i, -j])
            sys.exit(0)
        elif C[i] - C[j] == X:
            print(*[i, j])
            sys.exit(0)

Solution (Python):
import sys
from collections import defaultdict

sys.setrecursionlimit(10 ** 7)

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

X = int(input())

b = 10 ** 3
F5 = defaultdict(int)
for i in range(1, 10 ** 3):
    k = pow(i, 5)
    if X <= k:
        b = min(b, i)
    F5[k] = i

b -= 1
while True:
    x = X - pow(b, 5)
    if F5[x]:
        ans = (F5[x], -b)
        break

    b -= 1

print(ans[0], ans[1])

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

Solution (Python):
from collections import defaultdict, Counter, namedtuple, deque
import itertools
import functools
import bisect
import heapq
import math


NN = 202020
MOD = 10**9+7

INF = float("inf")

x = int(input())
for a in range(1, 1000):
    if pow(a, 5) - pow(a-1, 5) > x:
        break
    b = a-1
    while pow(a, 5) - pow(b, 5) <= x:
        if pow(a, 5) - pow(b, 5) == x:
            print(a, b)
            exit()
        else:
            b -= 1

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

Solution (Python):
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

def check(d1,d2):
    end = int(d2**(1/4))
    for A in range(end+1):
        B = A - d1
        test = A**4 + A**3*B + A**2*B**2 + A*B**3 + B**4
        if test == d2:
            return True, A, B
    return False, 0, 0
    

X = int(input())
div = make_divisors(X)


for d in div:
    f, A, B = check(d, X//d)
    if f:
        print(A, B)
        break

Solution (Python):
import sys

def make_divisors(n):
    D=[]
    for i in range(1, int(n**0.5)+1):
        if n%i==0:
            D.append(i)
            if i!=n//i:
                D.append(n//i)
    return list(sorted(D))

x=int(input())
D=make_divisors(x)
for d in D:
    
    now=-(d//2)
    cnt=0
    while cnt<=10**9:
        
        cnt=(now+d)**5-now**5
        if cnt==x:
            print(now+d,now)
            sys.exit()
        now+=1

Solution (Python):
can=[0]
for i in range(1,151):
    can.append(pow(i,5))
    can.append(-pow(i,5))
can.sort()

x=int(input())

end=False
for i in range(len(can)):
    for q in range(len(can)):
        if can[i]-can[q]==x:
            
            print(i-150,q-150)
            end=True
            break
    if end:
        break
else:
    raise ValueError("xx")