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):
mod = 10**9+7
import sys
from collections import Counter, defaultdict, deque
from itertools import product, permutations, combinations, combinations_with_replacement
from itertools import accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from math import ceil,floor
from copy import deepcopy
from heapq import heappop,heappush,heapify
import heapq







sys.setrecursionlimit(10 ** 6)

int1 = lambda x: int(x) - 1


p2D = lambda x: print(*x, sep="\n")

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 LLI(rows_number): return [LI() for _ in range(rows_number)]
def LI(): return list(map(lambda x:int(x), sys.stdin.readline().split()))
def HI(): return list(map(lambda x:int(x)*(-1), sys.stdin.readline().split()))

x = II()
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

if x==0:
	print(0,0)
else:
	div = make_divisors(x)
	tmp = []
	for l in div:

		tmp.append(-1*l)
	div += tmp
	p = 0
	a = None
	b = None
	while(1):
		for l in div:
			s = p**5 - (p-l)**5
			
			
			if s ==x:
				
				a=p
				b=p-l
			if s==(-x):
				
				b=p
				a=p-l

			
			
			
			
			
			
			

		if a is not None:
			break
		p += 1
	print(a,b)

Solution (Python):
X = int(input().strip())
a = 1
b = 0
while True:
    if X == a**5 - b**5:
        print(a, b)
        break
    elif X == a**5 + b**5:
        print(a, -b)
        break
    elif a**5 - b**5 < 0:
        b = 0
        a += 1
    else:
        b += 1

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

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])
    return arr

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

li = make_divisors(x)
for i in range(-1000,1000):
    for j in range(i+1,1000):
        if j-i in li:
            if j**5-i**5 == x:
                if x >= 0:
                    print(j,i)
                    exit()
                else:
                    print(i,j)
                    exit()

Solution (Python):
import math

x = int(input())

divisors = []

for i in range(1, int(x**0.5)+1):
    if x % i == 0:
        divisors.append(i)

        if i != x//i:
            divisors.append(x//i)


for i in divisors:
    for a in range(i//2,x,1):
        b = a - i
        if a**5 - b**5 == x:
            print(a, b)
            break
        elif a**5 - b**5 > x:
            break

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

for i in range(400):
	if s==0:
		for j in range(i,500):
			if j**5-i**5==x:
				print(j,i)
				s+=1	
				break
	else:
		break

Solution (Python):
X = int(input())
Y = int(pow(X, 1/5) * 2)

for a in range(1, Y+1, 1):
  r = (a ** 5) - X
  b = 0
  if r >= 0:
    b = pow(r, 1/5)
  else:
    b = -pow(-r, 1/5)
  if round(b) ** 5 == r:
    print(a, int(b))
    break

Solution (Python):
import bisect as bs
import sys

x = int(input())

dic = {}

i = 1
while True:
  if i ** 5  > 10 ** 12:
    break
    
  dic[i ** 5] = i
  dic[-(i ** 5)] = -i
    
  i += 1
  
i = 0
while True:
  if i ** 5 > 10 ** 12:
    break
    
  tmp = x + (i ** 5)
  if tmp in dic.keys():
    print(dic[tmp], i)
    sys.exit(0)
    
  tmp = x - (i ** 5)
  if tmp in dic.keys():
    print(dic[tmp], -i)
    sys.exit(0)
    
  i += 1

Solution (Python):
def pow_k(x, n):
    """
    O(log n)
    """
    if n == 0:
        return 1

    K = 1
    while n > 1:
        if n % 2 != 0:
            K *= x
        x *= x
        n //= 2

    return K * x

x = int(input())

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

Solution (Python):
flag = 0
X = int(input())
for A in range(1000):
    if flag!=0:
        break
    for B in range(1000):
        if A**5 - B**5 == X:
            print(str(A) + " " + str(B))
            flag=1
            break
        elif A**5 + B**5 == X:
            print(str(A) + " " + str(-B))
            flag=1
            break

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

d = make_divisors(X) 

ans =[0,0]

for i in d:

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

Solution (Python):
def cul(A,B):
	ret = pow(A,5)-pow(B,5)
	return ret

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(reverse = True)
    return divisors

if __name__ == '__main__':
	X = int(input())
	ls = make_divisors(X)
	c = 0
	A = 0
	B = 0
	
	ls.append(0)
	for d in ls:
		a = d//2
		v = 0

		while(v < X):
			b = a-d
			v = cul(a,b)
			
			
			if v == X:
				A = a
				B = b
				c = 1
			else:
				a += 1

		if c == 1:
			break

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

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

Y = make_divisors(X)

for i in range(2*len(Y)):
    if i%2 == 0:
        t = Y[i//2]
    else:
        t = -1*Y[i//2]
    for j in range(400):
        s = j-200
        if (s+t)**5 - s**5 == X:
            print(s+t,s)
            break
        else:
            pass

Solution (Python):

X = int(input())

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

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

Solution (Python):
x = int(input())
lim = int(x**(1/5))+1

for a in range(10**6):
    mul = 1
    if a**5 < x:
        mul = -1
    
    b = ((a**5 - x)*mul)**(1/5)
    b*=mul
    b = int(b)
    if a**5 - b**5 == x:
        print(a, b)
        exit()

Solution (Python):
m=int(input())
flag=True
for i in range(100000):
    n=(m+i**5)**0.2
    if round(n)**5-i**5==m:
        print(int(n),i)
        break
    if flag:
        n=(m-i**5)**0.2
        if type(n)==complex:
            flag=False
        elif round(n)**5+i**5==m:
            print(int(n),-i)
            break

Solution (Python):
num = int(input())
list = [i ** 5 for i in range(1000)]
ans = []
for a in range(1000):
    for b in range(1000):
        if list[a] - list[b] == num: 
            ans = [a, b]
            break
        if list[a] + list[b] == num:
            ans = [a, b * (-1)]
            break
print(' '.join(map(str, ans)))

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

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

Solution (Python):

import itertools
import numpy as np
x = int(input())






max_x = pow(10, 18)
v = 0
v_lis = [0]
i = 1
while max_x > v:
    v = pow(i, 5)
    v_lis.append(v)
    v_lis.append(-v)
    i += 1

for a5, b5 in itertools.combinations_with_replacement(v_lis, 2):
    if (a5 - b5 == x):
        if (a5 < 0):
            a = int(pow(a5*-1, 1 / 5)) * -1
        else:
            a = int(pow(a5, 1 / 5))
        if (b5 < 0):
            b = int(pow(b5*-1, 1/5))*-1
        else:
            b = int(pow(b5, 1/5))
        print(a, b)
        exit()


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr

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

Solution (Python):
import sys
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    X = int(input())
    for A in range(-100,10000):
        for B in range(-100,A+1):
            if A**5-B**5==X:
                print(A, B)
                sys.exit()


if __name__ == '__main__':
    main()

Solution (Python):
import math
X = int(input())
res = False
for A in range(1,1000):
    for B in range(-1000, A):
        if math.pow(A, 5) - math.pow(B, 5) == X:
            res = True
            break

    if res:
        break

print(A, B)

Solution (Python):
import sys
input=lambda: sys.stdin.readline().rstrip()
x=int(input())
A=[int(i) for i in range(201)]
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())

for a in range(1,110):
    if X%a==0:
        i=-a//2
        while (i+a)**5-i**5<=X:
            if (i+a)**5-i**5==X:
                print(i+a,i)
                break
            i+=1

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


for b in range(121):
  for a in range(b+1,122):
    kx = (a**5) - (b**5)
    if kx == x:
      print('{} {}'.format(a,b))
      exit()
    elif kx > x:
      break

for b in range(121):
  for a in range(b+1,122):
    kx = (a**5) + (b**5)
    if kx == x:
      print('{} {}'.format(a,-b))
      exit()
    elif kx > x:
      break

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

for i in range(10**9):
  for j in lis:
    if i**5-(i-j)**5==X:
      print(i, i-j)
      exit()

Solution (Python):
X = int(input())
l = list()
i = int()
while i**5-(i-1)**5 <= 10**9:
    l.append(i**5)
    l.append(0-i**5)
    i += 1
for i in range(len(l)):
    for j in range(i, len(l)):
        if abs(l[i]-l[j])==X:
            if l[i]-l[j]==X:
                A=l[i]
                B=l[j]
            else:
                A=l[j]
                B=l[i]
            
            ifAM=False
            ifBM=False
            if A<0:
                ifAM=True
            if B<0:
                ifBM=True
            A=int(abs(A)**0.2)
            B=int(abs(B)**0.2)
            if ifAM:
                A=0-A
            if ifBM:
                B=0-B
            print(A, B)
            exit()

Solution (Python):
i=int(input())
f=0
for j in range(150):
    for k in range(-150,150):
        if j**5-k**5==i:
            print(j, k)
            f=1
            break
    if f==1:
        break

Solution (Python):
import math
x=int(input())
flag=0
for i in range(150,0,-1):
    for j in range(-100,i):
        if pow(i,5)-pow(j,5)==x:
            print(i,j)
            flag=1
    if flag==1:
        break

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

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

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

Solution (Python):


X=int(input())
flag=True


for a in range(1,100):
    if a**5==X:
        flag=False
        print(a,0)
        break


if flag:
    br=False
    for a in range(1,101):
        for b in range(1,101):
            if a**5+b**5==X:
                flag=False
                br=True
                print(a,-b)
                break
        if br:
            break
        

if flag:
    br=False
    for b in range(1,201):
        for a in range(b+1,201):
            if X%(a-b)==0:
                if a**5-b**5==X:
                    print(a,b)
                    br=True
                    break
        if br:
            break

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

D = make_divisors(x)
for i in D:
    for j in range(-10000,10000):
        k = j +  i
        if k**5 - j**5 == x:
            a, b = k, j
            break

print(a,b)

Solution (Python):
X = int(input())
A = 0
B = int(-X**(1/5))

while True:
  ans = A**5-B**5
  if ans == X:
    break
  elif ans < X:
    A += 1
  elif ans > X:
    B += 1
print("{} {}".format(A,B))

Solution (Python):
X = int(input())
plus = [i**5 for i in range(1000)]

for num in plus:
  if abs(X - num) in plus:
    break
    
if (X - num) in plus:
  print(plus.index(num), -1*plus.index(X-num))
else:
  print(plus.index(num), plus.index(num-X))

Solution (Python):
hoge = {}
for i in range(1000):
    hoge[i] = i**5
for i in range(1000):
    hoge[-i] = -i**5
x = int(input())
for i in hoge.items():
    for j in hoge.items():
        if i[1] - j[1] == x:
            print(i[0], j[0])
            break
    else:
        continue
    break

Solution (Python):
import numpy as np

X = int(input())

A = -1000
is_finish = False
while 1:
    B = -1000
    while 1:
        if X+B**5 == A**5:
            print("%d %d"%(A,B))
            is_finish=True
            break
        if X+B**5 > A**5:
            break
        B+=1
    A+=1
    if is_finish:
        break

Solution (Python):
import math
x=int(input())
flag=0
for i in range(150,0,-1):
    for j in range(-100,i):
        if pow(i,5)-pow(j,5)==x:
            print(i,j)
            flag=1
    if flag==1:
        break

Solution (Python):
import itertools
import math
import sys

X = list(range(-200,201))

X_list = list(map(lambda x: x ** 5, X))



ans = int(input())



for x in itertools.combinations(X_list, 2):
  if x[0]-x[1] == ans:
      a =abs(x[0]**(1/5))
      b =abs(x[1]**(1/5))
      if x[0] < 0:
          a = a*(-1)
      if x[1] < 0:
          b = b*(-1)
    
      print(int(a),int(b))
      sys.exit()
  if x[1]-x[0] == ans:
      a = abs(x[1]**(1/5))
      b = abs(x[0]**(1/5))
      if x[1] < 0:
          a = a*(-1)
      if x[0] < 0:
          b = b*(-1)
    
      print(int(a),int(b))
      sys.exit()

Solution (Python):
import sys
X=int(input())
for i in range(10**3):
  for k in range(-10**3,10**3):
    if i**5-k**5==X:
      print(i,k)
      sys.exit()

Solution (Python):
import sys
x=int(input())
a=0
while True:
  for i in range(-64,a):
    if a**5-i**5==x:
      print(a,i)
      sys.exit()
  a+=1

Solution (Python):
import sys
import heapq
import re
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from math import factorial, sqrt, ceil, gcd
from functools import lru_cache, reduce
INF = 1 << 60
MOD = 1000000007
sys.setrecursionlimit(10 ** 7)


class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


def dijkstra_heap(s, edge, n):
    
    d = [10**20] * n
    used = [True] * n 
    d[s] = 0
    used[s] = False
    edgelist = []
    for a,b in edge[s]:
        heapq.heappush(edgelist,a*(10**6)+b)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        
        if not used[minedge%(10**6)]:
            continue
        v = minedge%(10**6)
        d[v] = minedge//(10**6)
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,(e[0]+d[v])*(10**6)+e[1])
    return d


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr


def lcm(x, y):
    return (x * y) // gcd(x, y)


def lcm_list(numbers):
    return reduce(lcm, numbers, 1)


def gcd_list(numbers):
    return reduce(gcd, numbers)


def is_prime(n):
    if n <= 1:
        return False
    p = 2
    while True:
        if p ** 2 > n:
            break
        if n % p == 0:
            return False
        p += 1
    return True



def eratosthenes(limit):
    A = [i for i in range(2, limit+1)]
    P = []

    while True:
        prime = min(A)
        
        if prime > sqrt(limit):
            break
            
        P.append(prime)
            
        i = 0
        while i < len(A):
            if A[i] % prime == 0:
                A.pop(i)
                continue
            i += 1
            
    for a in A:
        P.append(a)
            
    return P


def permutation_with_duplicates(L):

    if L == []:
        return [[]]

    else:
        ret = []

        
        S = sorted(set(L))

        for i in S:

            data = L[:]
            data.remove(i)

            for j in permutation_with_duplicates(data):
                ret.append([i] + j)

        return ret



x = int(input())
for a in range(10 ** 5):
    for b in range(-10 ** 3, 10 ** 3):
        if x == a ** 5 - b ** 5:
            print(a, b)
            sys.exit()

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

i = -1
b = 0
judge = 0
flag = True
while flag:
    i += 1
    judge = i ** 5 - x
    if judge < 0:
        b = -1
        judge = - judge
        temp = - b ** 5
        while temp <= judge:
            if temp == judge:
                flag = False
                break
            else:
                b -= 1
                temp = - b ** 5
    elif judge == 0:
        b = 0
        break
    else:
        b = 1
        temp = b ** 5
        while temp <= judge:
            if temp == judge:
                flag = False
                break
            else:
                b += 1
                temp = b ** 5
        
print(i, b)

Solution (Python):
from sys import exit
X = int(input())
p = [0]*122
for i in range(122):
    p[i] = pow(i , 5)
for i in range(122):
    a = p[i]
    for j in range(i):
        if a-p[j] == X:
            print(i, j)
            exit()
    for j in range(i, 122):
        if a+p[j] == X:
            print(i, -1*j)
            exit()

Solution (Python):
X = int(input())
C= [i**5 for i in range(1000)]

a = 0
b = 0

for a in range(len(C)):
    for b in range(len(C)):
        if C[a] + C[b] == X:
            print(a, -b)
            exit(0)
        elif C[a] - C[b] == X:
            print(a, b)
            exit(0)

Solution (Python):
x=int(input())
a=0
b=0
set5 = set([i**5 for i in range(1000)])
set5 = set5 | set([-i**5 for i in range(1000)])
while True:
    a += 1
    
    
    
    
    
    
    temp = (a**5-x)
    if temp in set5:
        if a**5-x < 0:
            b = -int((-temp)**(1/5)+0.01)
        else:
            b = int(temp**(1/5)+0.01)
        print(str(a)+" "+str(b))
        break

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

A = []
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())
a = []

for i in range(500):
    num = i ** 5
    a.append(num)

for i in range(500):
    for j in range(i, 500):
        if a[i] - a[j] == x:
            ans = str(i) + ' ' + str(j)
            break
        elif a[i] + a[j] == x:
            ans = str(i) + ' -' + str(j)
            break
        elif a[j] - a[i] == x:
            ans = '-' + str(i) + ' -' + str(j)
            break

print(ans)

Solution (Python):
x=int(input())
for i in range(200):
    a=i
    for j in range(-200,i):
        b=j
        if a**5-b**5==x:
            am=a
            bm=b
        else:
            c=0
print(am,bm)

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

comb = list(itertools.product([_ for _ in range(-70, 140)],repeat=2))

for c in comb:
    a, b = c[0], c[1]
    if a**5 - b**5 == x:
        print(a, b)
        break

Solution (Python):
x = int(input())
sq = []
for i in range(10**3):
    sq.append(i**5)
    sq.append(-i**5)
b = False
for i in range(len(sq)):
    for j in range(len(sq)-i):
        if sq[-i-1]-sq[j] == x:
            if i%2 == 0:
                m = -1
            else:
                m = 1
            if j%2 == 0:
                n = 1
            else:
                n = -1
            print(m*(1000-(i//2+1)), n*(j//2))
            b = True
            break
    if b:
        break

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

def binp(arr, val):
    left,right = 0,len(arr)-1
    while left <= right:
        mid = (left+right)//2
        if val==arr[mid]: return mid
        elif val>=arr[mid]: left = mid+1
        else: right = mid-1
    return 0

def binn(arr, val):
    left,right = 0,len(arr)-1
    while left >= right:
        mid = (left+right)//2
        if val==arr[mid]: return mid
        elif val>=arr[mid]: right = mid+1
        else: left = mid-1
    return 0

ap = [i**5 for i in range(n)]
an = [-(i**5) for i in range(n)]

for b in range(-n,n):
    val = x + b**5
    a = max(binp(ap, val), binn(an,val))
    if a: print(a,b) ; break

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


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


main()

Solution (Python):
import math
a=[1, 32, 243, 1024, 3125, 7776, 16807, 32768, 59049, 100000, 161051, 248832, 371293, 537824, 759375, 1048576, 1419857, 1889568, 2476099, 3200000, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176, 69343957, 79235168, 90224199, 102400000, 115856201, 130691232, 147008443, 164916224, 184528125, 205962976, 229345007, 254803968, 282475249, 312500000, 345025251, 380204032, 418195493, 459165024, 503284375, 550731776, 601692057, 656356768, 714924299, 777600000, 844596301, 916132832, 992436543, 1073741824, 1160290625, 1252332576, 1350125107, 1453933568, 1564031349, 1680700000, 1804229351, 1934917632, 2073071593, 2219006624, 2373046875, 2535525376, 2706784157, 2887174368, 3077056399, 3276800000, 3486784401, 3707398432, 3939040643, 4182119424, 4437053125, 4704270176, 4984209207, 5277319168, 5584059449, 5904900000, 6240321451, 6590815232, 6956883693, 7339040224, 7737809375, 8153726976, 8587340257, 9039207968, 9509900499, 10000000000, 10510100501, 11040808032, 11592740743, 12166529024, 12762815625, 13382255776, 14025517307, 14693280768, 15386239549, 16105100000, 16850581551, 17623416832, 18424351793, 19254145824, 20113571875, 21003416576, 21924480357, 22877577568, 23863536599, 24883200000]
x=int(input())
p=0
if x==1:
    print(0,-1)
else:
    for i in range(len(a)):
        for j in range(len(a)):
            if a[j]-a[i]==x :
                print(j+1,i+1)
                p+=1
                break
            elif a[j]+a[i]==x:
                print(j+1,-i-1)
                p+=1
                break
        if p>0:
            break

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

Solution (Python):
x=int(input())
a=1
while True:
    if a**5-x>0:
        for b in range(a):
            if x==a**5-b**5:
                print("{0} {1}".format(a,b))
                exit()
    elif a**5-x<0:
        b=-1
        while True:
            if b**5<a**5-x:
                break
            if x==a**5-b**5:
                print("{0} {1}".format(a,b))
                exit()
            b-=1
    else:
        b=0
        print("{0} {1}".format(a,b))
        exit()
    a+=1

Solution (Python):


a = int(input())
lister = []
dicter = dict()
for i in range(0, 121):
    lister.append(i ** 5)
    lister.append(-i ** 5)
    dicter[i ** 5] = i
    dicter[- i ** 5] = -i

for i in range(1, 121):
    no = i ** 5 - a
    if no in lister:
        print(i, dicter[no])
        break

Solution (Python):


import math

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

     num_list = []
     len_num_list = 0

     a = 0
     end = False
     while(not end):
          num_list.append(pow(a, 5))
          len_num_list += 1

          
          

          for i in range(len_num_list):
               for j in range(i, len_num_list):
                    i_5div = num_list[i]
                    j_5div = num_list[j]

                    if i_5div - j_5div == x:
                         print('{} {}'.format(i, j))
                         end = True
                         break
                    if j_5div - i_5div == x:
                         print('{} {}'.format(j, i))
                         end = True
                         break
                    if i_5div + j_5div == x:
                         print('{} {}'.format(i, j * (-1)))
                         end = True
                         break
                    if j_5div + i_5div == x:
                         print('{} {}'.format(j, i * (-1)))
                         end = True
                         break

          a += 1


if __name__ == "__main__":
    main()

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

a = 0

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

while True:
    for divisor in divisors:
        b = a - divisor
        if a**5-x == b**5:
            break
    else:
        a += 1
        continue
    break

print(a, b)

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

xset = set([])

for i in range(10000):
    xset.add(i**5)
    xset.add(-i**5)

for xx in xset:
    if xx+x in xset:
        a5 = xx+x
        b5 = xx

if a5 < 0:
    a = -pow(-a5, 0.2)
else:
    a = pow(a5, 0.2)

if b5 < 0:
    b = -pow(-b5, 0.2)
else:
    b = pow(b5, 0.2)

print(int(a), int(b))

Solution (Python):
from sys import stdin
import random



'''
while x < 1 or x > 10**9:
    a = random.randint(-100, 100)
    b = random.randint(-100, 100)
    x = a**5 - b**5
'''

x = int(stdin.readline().rstrip())

fivelist = []

i = 0
while True:
    n = i**5
    
    if n > 2*(10**15):
        break
    fivelist.append(n)
    i += 1


a = 0
b = 0
ans = False
for i in range(len(fivelist)):
    for j in range(len(fivelist)):
        if x == (fivelist[i] - fivelist[j]):
            a, b = i, j
            ans = True
            break
        if x == (-fivelist[i] - fivelist[j]):
            a, b = -i, j
            ans = True
            break
        if x == (fivelist[i] + fivelist[j]):
            a, b = i, -j
            ans = True
            break
        if x == (-fivelist[i] + fivelist[j]):
            a, b = -i, -j
            ans = True
            break
    if ans:
        break

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

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

is_found = False
for i in range(-500, 501):
    for j in range(-500, 501):
        if i**5 - j**5 == x:
            print(i, j)
            is_found = True
        if is_found:
            break
    if is_found:
        break

Solution (Python):
def f(x):
    div = 1
    while div * div <= x:
        if x % div == 0:
            for a in range(0, int((x // div) ** 0.25) + 2):
                b = a - div
                if a ** 5 - b ** 5 == x:
                    return a, b

            opp_div = x // div
            for a in range(0, int((x // opp_div) ** 0.25) + 2):
                b = a - opp_div
                if a ** 5 - b ** 5 == x:
                    return a, b
        div += 1


def main():
    x = int(input())
    a, b = f(x)
    print(a, b)


main()

Solution (Python):
x = int(input())
pow5 = [i**5 for i in range(10**3)]
powp = []
pown = []
for i in range(10**3):
    powp.append(pow5[i])
    pown.append(-pow5[i])

for i, ii in enumerate(pow5):
    for j, ji in enumerate(powp):
        if ii - ji == x:
            
            print(i, j)
            exit()
    for j, ji in enumerate(pown):
        if ii - ji == x:
            
            print(i, -j)
            exit()

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

Solution (Python):
x=int(input())
l=[]

for i in range(300):
    a=i**5
    l.append(a)
    l.append(-a)
        

for j in l:
    for k in l:
        aa=j-k
        if j!=k and aa==x:
            ans=[]
            for z in [j,k]:
                aaa=abs(z)**(1/5)
                if z>=0:
                    ans.append(int(aaa))
                else:
                    ans.append(int(-aaa))
            print(*ans)                
            exit()

Solution (Python):
x = int(input())
a=0
f=False
while(1):
    b=a
    while(1):
        t = a**5-b**5
        if t==x:
            f=True
            break
        if t>x:
            break
        b-=1
    if f:break
    a+=1
print(a,b)