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

Solution (Python):
def main(sample_file = ''):

    """ convenient functions
    
    
    
    
    
    """

    """convenient decorator
    
    
        
        
        
        
        
        
        
        
        
        
    """
    
    
    import sys
    sys.setrecursionlimit(10**7)
    from itertools import accumulate, combinations, permutations, product 
    
    from math import factorial, ceil, floor, sqrt
    def factorize(n):
        """return the factors of the Arg and count of each factor
        
        Args:
            n (long): number to be resolved into factors
        
        Returns:
            list of tuples: factorize(220) returns [(2, 2), (5, 1), (11, 1)]
        """
        fct = []  
        b, e = 2, 0  
        while b * b <= n:
            while n % b == 0:
                n = n // b
                e = e + 1
            if e > 0:
                fct.append((b, e))
            b, e = b + 1, 0
        if n > 1:
            fct.append((n, 1))
        return fct
    def combinations_count(n, r):   
        """Return the number of selecting r pieces of items from n kinds of items.
        
        Args:
            n (long): number
            r (long): number
        
        Raises:
            Exception: not defined when n or r is negative
        
        Returns:
            long: number
        """
        
        if n < 0 or r < 0:
            raise Exception('combinations_count(n, r) not defined when n or r is negative')
        if n - r < r: r = n - r
        if r < 0: return 0
        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 combinations_with_replacement_count(n, r):
        """Return the number of selecting r pieces of items from n kinds of items allowing individual elements to be repeated more than once.
        
        Args:
            n (long): number
            r (long): number
        
        Raises:
            Exception: not defined when n or r is negative
        
        Returns:
            long: number
        """
        if n < 0 or r < 0:
            raise Exception('combinations_with_replacement_count(n, r) not defined when n or r is negative')
        elif n == 0:
            return 1
        else:
            return combinations_count(n + r - 1, r)
    from bisect import bisect_left, bisect_right
    from collections import deque, Counter, defaultdict 
    from heapq import heapify, heappop, heappush, heappushpop, heapreplace,nlargest,nsmallest 
    from copy import deepcopy, copy 
    import operator
    from operator import itemgetter 
    
    
    from functools import reduce, lru_cache
    def chmin(x, y):
        """change minimum
        if x > y, x = y and return (x, True).
        convenient when solving problems of dp[i]
        
        Args:
            x (long): current minimum value
            y (long): potential minimum value
        
        Returns:
            (x, bool): (x, True) when updated, else (x, False)
        """
        if x > y:
            x = y
            return (x, True)
        else:
            return (x, False)
    def chmax(x, y):
        """change maximum
        if x < y, x = y and return (x, True).
        convenient when solving problems of dp[i]
        
        Args:
            x (long): current maximum value
            y (long): potential maximum value
        
        Returns:
            (x, bool): (x, True) when updated, else (x, False)
        """
        if x < y:
            x = y
            return (x, True)
        else:
            return (x, False)

    from fractions import gcd 
    def gcds(numbers):
        return reduce(gcd, numbers)
    def lcm(x, y):
        return (x * y) // gcd(x, y)
    def lcms(numbers):
        return reduce(lcm, numbers, 1)
    def make_divisors(n, reversed=False):
        """create list of divisors
        
        Args:
            number (int): number from which list of divisors is created
            reversed (bool, optional): ascending order if False. Defaults to False.
        
        Returns:
            list: list of divisors
        """
        divisors = set()
        for i in range(1, int(n**0.5)+1):
            if n % i == 0:
                divisors.add(i)
                divisors.add(n//i)
        return sorted(list(divisors),reverse=reversed)
    
    
    
    INF = 10 ** 18
    MOD = 10 ** 9 + 7
    AtoZ = list('abcdefghijklmnopqrsruvwxyz')
    modpow = lambda a, n, p = MOD: pow(a, n, p) 
    def modinv(a, p = MOD):
        
        
        return modpow(a, p-2, p)
    def modinv_list(n, p = MOD):
        if n <= 1:
            return [0,1][:n+1]
        else:
            inv_t = [0,1]
            for i in range(2, n+1):
                inv_t += [inv_t[p % i] * (p - int(p / i)) % p]
            return inv_t
    def modfactorial_list(n, p = MOD):
        if n == 0:
            return [1]
        else:
            l = [0] * (n+1)
            tmp = 1
            for i in range(1, n+1):
                tmp = tmp * i % p
                l[i] = tmp
            return l
    def modcomb(n, k, fac_list = [], p = MOD):
        
        
        from math import factorial
        if n < 0 or k < 0 or n < k: return 0
        if n == 0 or k == 0: return 1
        if len(fac_list) <= n:
            a = factorial(n) % p
            b = factorial(k) % p
            c = factorial(n-k) % p
        else:
            a = fac_list[n]
            b = fac_list[k]
            c = fac_list[n-k]
        return (a * modpow(b, p-2, p) * modpow(c, p-2, p)) % p
    def modadd(a, b, p = MOD):
        return (a + b) % MOD
    def modsub(a, b, p = MOD):
        return (a - b) % p
    def modmul(a, b, p = MOD):
        return ((a % p) * (b % p)) % p
    def moddiv(a, b, p = MOD):
        return modmul(a, modpow(b, p-2, p))

    class UnionFindTree:
        """union find tree class
        TODO: fix this description...
        how to use (example):
        >>  uf = UnionFindTree(N) 
        >>  if uf.find_root(a) == uf.find_root(b):
        >>      do something
        >>  else:
        >>      do something
        >>      uf.unite(a, b)
        """
        def __init__(self, N):
            self.root = [-1] * (N+1)
            self.rank   = [0]  * (N+1)
            self.connected_num = [1] * (N+1)
    
        def find_root(self,x):
            root = self.root
            while root[x] != -1:
                x = root[x]
            return x
    
        def unite(self,x,y):
            root = self.root
            rank = self.rank
            connected_num = self.connected_num
            find_root = self.find_root
    
            rx = find_root(x)
            ry = find_root(y)
            if rx != ry:
                if rank[rx] < rank[ry]:
                    root[rx] = ry
                    rx,ry = ry,rx
                else:
                    if rank[rx] == rank[ry]:
                        rank[rx] += 1
                    root[ry] = rx       
                connected_num[rx] += connected_num[ry]

    
    
    
    
    

    def BellmanFord(N, M, ABC, vertex_start, vertex_end, value_if_inf = -1, find_shortest = False):
        """to calculate furthest or shortest length between vertex_start and vertex_end using BellmanFord algorithm
        
        Args:
            N (int): number of vertices
            M (int): number of edges
            ABC (list): [(ai, bi, ci) for _ in range(N)] where i-th edge is directed from vertex ai to vertex bi and the length is ci 
            vertex_start (int): start vertex. usually use 0.
            vertex_end (int): end vertex. usually use N-1.
            value_if_inf (int or string as you like, optional): value you want when the furthest (or shortest) distance is infinite (or -infinite). Defaults to -1.
            find_shortest (bool, optional): choose False to find furthest path. Defaults to False.
        
        Returns:
            int or string: normally int (but can be str if you set value_if_inf to str)
            
        Example:
                N, M, P = R()
                ABC = [R() for _ in range(M)]
                ABC = [(a-1, b-1, c-P) for a, b, c in ABC]
                print(BellmanFord(N, M, ABC, 0, N-1, value_if_inf = 'inf'))

        """

        def make_reachable_list(N, M, ABC, vertex_start, vertex_end):
            reachable_to_direct = defaultdict(list)
            reachable_from_direct = defaultdict(list)
            reachable_from_start = [False] * N
            reachable_to_end = [False] * N
            reachable_from_start[vertex_start] = True
            reachable_to_end[vertex_end] = True
            reachable_from_both_sides = [False] * N
            dfs_from_start = []
            dfs_to_end = []
            for a, b, c in ABC:
                reachable_to_direct[a].append(b)
                reachable_from_direct[b].append(a)
                if a == vertex_start:
                    dfs_from_start.append(b)
                    reachable_from_start[b] = True
                if b == vertex_end:
                    dfs_to_end.append(a)
                    reachable_to_end[a] = True
            while dfs_from_start:
                v = dfs_from_start.pop()
                for i in reachable_to_direct[v]:
                    if not reachable_from_start[i]:
                        reachable_from_start[i] = True
                        dfs_from_start.append(i)
            while dfs_to_end:
                v = dfs_to_end.pop()
                for i in reachable_from_direct[v]:
                    if not reachable_to_end[i]:
                        reachable_to_end[i] = True
                        dfs_to_end.append(i)
            for i in range(N):
                reachable_from_both_sides[i] = reachable_from_start[i] and reachable_to_end[i]
            return reachable_from_both_sides
        
        reachable_from_both_sides = make_reachable_list(N, M, ABC, vertex_start, vertex_end)
        
        if find_shortest:
            dist = [INF for i in range(N)]
        else:
            dist = [-INF for i in range(N)]
        
        dist[vertex_start] = 0
        for i in range(N):
            updated = False
            for a, b, c in ABC:
                if not reachable_from_both_sides[a]:
                    continue
                elif find_shortest:
                    update_condition = dist[a] + c < dist[b]
                else:
                    update_condition = dist[a] + c > dist[b]
                if dist[a] != INF and update_condition:
                    dist[b] = dist[a] + c
                    updated = True
                    if i == N-1:
                        return value_if_inf
            if not updated:
                break
        return dist[vertex_end]

    """ initialize variables and set inputs
    
        
        
            
            
    
        
        
        
        
        
        
        
    
        
        
        
        
    
        
        
    """

    
    r = lambda: sys.stdin.readline().strip()
    r_int = lambda: int(r())
    r_float = lambda: float(r())
    R = lambda: list(map(int, r().split()))
    R_str = lambda: r().split()
    R_map = lambda: map(int, r().split())
    R_float = lambda: list(map(float, r().split()))
    R_tuple = lambda: tuple(map(int, r().split()))

    """ how to treat input
    
    
    
    
    
    
    
    """

    
    if sample_file:
        sys.stdin = open(sample_file)
        
    
    
    
    X = r_int()
    for i in range(-1000, 1000):
        for j in range(-1000, 1000):
            if i**5 - j**5 == X:
                print(i, j)
                return
    

    
    
    

    """memo: how to use defaultdict of list
    
    Dic = defaultdict(list)
    
    Dic[x].append(y)
    
    for k, v in Dic.items():
    """
    
    """memo: how to solve binary problems
    
    >>> a = 5
    >>> bin_str_a = format(a, '
    >>> print(bin_str_a)
    0b0101 
    """
    
    """memo: how to solve the problem
    creating simple test/answer
    greed
    simple dp
    graph
    """

if __name__ == '__main__':
    main()

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

flg = 'n'
for a in range(-120, 121, 1):
    for b in range(-120, 121, 1):
        if a ** 5 - b ** 5 == x:
            flg = 'y'
            break
    if flg == 'y':
        break
print(a, b)

Solution (Python):
import itertools

s = 119
X = int(input())

l = [i ** 5 for i in range(-1 * s, s)]

for i, j in itertools.permutations(l, 2):
    if(i + j == X):
        print (l.index(i) - s, l.index(j) - s)
        exit(0)

    if(i - j == X):
        print (l.index(i) - s, l.index(j) - s)
        exit(0)

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

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

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

list = []
for i in range(-119,120):
    list.append(i)
for j in range(len(list)):
    for k in range(len(list)):
        if X == (list[j]) ** 5 - list[k] ** 5:
            A = list[j]
            B = list[k]
            break

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

Solution (Python):
x=int(input())
[i**5-x-j**5or exit(print(i,j))for i in range(200)for j in range(-i,i)]

Solution (Python):


x = int(input())





a = 0
while True:
    b = a - 1
    while a ** 5 - b ** 5 < x:
        b -= 1
    if a ** 5 - b ** 5 == x:
        print(a, b)
        exit()
    a += 1

Solution (Python):
x=int(input())
[i**5-x-j**5or print(i,j)+exit()for i in range(200)for j in range(-i,i)]

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

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

Solution (Python):
def eval_pair(A, B, x):
  return A**5-B**5 == x

def get_pair(x):
  
  
  A = int(round(x**(1/5)))
  if A**5 == x: return (A, 0)
  
  
  
  
  
  
  valid = [(A,B) for A in range(1,120) for B in range(1,119) if eval_pair(A,B,x)]
  if valid: return valid.pop()
  
  
  valid = [(A,B) for A in range(1,64) for B in range(-1,-64, -1) if eval_pair(A,B,x)]
  if valid: return valid.pop()

x = int(input())
valid_pair = get_pair(x)
print(*valid_pair)

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

for A in range(-118, 120):
	for B in range(-119, 119):
		if target == A ** 5 - B ** 5:
			print(f'{A} {B}')
			exit(0)

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

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

Solution (Python):
X = int(input())
pin = 0
for i in range(-120, 120):
    if pin == 1:
        break
    for j in range(-120, 120):
        if pow(i, 5) - pow(j, 5) == X :
            pin =1
            print(i, j)
            break

Solution (Python):
def main():
    x = int(input())
    ans = solve(x)
    print(*ans if ans is not None else '')


def solve(x):
    numbers = {i:i ** 5 for i in range(10 ** 3 + 1)}
    
    for n1, i in numbers.items():
        for n2, j in numbers.items():
            if i - j == x:
                return n1, n2
            if i + j == x:
                return n1, -n2


if __name__ == '__main__':
    main()

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):
X=int(input())
for a in range(-118,120):
  for b in range(-118,120):
    if a**5-b**5==X:
      print(a,b)
      exit(0)

Solution (Python):
import itertools
import math
import string
import collections
from collections import Counter
from collections import deque
import sys
sys.setrecursionlimit(2*10**5)
INF = 2**60


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


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor



dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]

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):
x=int(input())
[print(i,j)+exit()for i in range(200)for j in range(-i,i)if i**5-j**5==x]

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

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

Solution (Python):
s = list(map(int,input().split()))
x=s[0]
a=0

for i in range(-118,119):
    for j in range(-120,120):
        a=i**5-j**5
        if a==x:
            print(i,j)
            break
    else:
        continue
    break

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

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

Solution (Python):
x = int(input())
rep = 10**4
for i in range(rep):
    for j in range(rep):
        if i**5-j**5==x:
            print(i,j)
            exit()
        elif i**5+j**5==x:
            print(i,-j)
            exit()

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

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

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

Solution (Python):
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(-200,200):
  for j in range(-200,200):
    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 pow(a, 5) - pow(b, 5) == x:
            print('{} {}'.format(a, b))
            break
    else:
        continue
    break

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

for a in range(-118,119,1):
    for b in range(-119,118,1):
        if a**5-b**5 == x:
            break

    else:
        continue
    break

print(str(a)+' '+str(b))

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

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():

    def main():
        X=int(input())
        for a in range(-200,200):
            for b in range(-200,200):
                if pow(a,5)-pow(b,5)==X:
                    return [a,b]
    print(*main())

resolve()

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

def binary_search(b):
    l, r = -10 ** 9, 10 ** 9
    while r-l > 1:
        m = (l+r)//2
        x = m**5 - b**5
        if x < X:
            l = m
        else:
            r = m
    return r

for b in range(-200, 200):
    a = binary_search(b)
    if a ** 5 - b ** 5 == X:
        print(a, b)
        break

Solution (Python):
X=int(input())
for i in range(-118,120):
  for j in range(-119,119):
    if i**5-(j)**5==X:
      print(i,j,sep=" ")
      break
  else:
    continue
  break

Solution (Python):


x = int(input())





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

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

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

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

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

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

for a in range(-120, 120):
    a5 = a**5
    for b in range(-120, 120):
        if (a5 < x and b >= 0 ) or (a5 > x and b <= 0):
            continue
        if a5 - b**5 == x:
            print(a, b)
            break
    else:
        continue
    break

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

Solution (Python):

import math
import sys

X = int(input())

for A in range(-118, 120):
  for B in range(-119, 119):
    val = math.pow(A, 5) - math.pow(B, 5)
    if(val == X):
      print(A, B)
      sys.exit()

Solution (Python):
x=int(input())
for i in range(-120,120):
    for l in range(-120,120):
        g=i**5
        g-=l**5
        if g==x:
            print('{} {}'.format(i,l))
            exit()

Solution (Python):
x=int(input())
A = 0
B = 0
for a in range(-120, 120):
    a5 = a**5
    for b in range(-120, 120):
        if (a5 < x and b >=0 ) or (a5 > x and b <= 0):
            continue
        if a5 - b**5 == x:
            A = a
            B = b
            break
print(A, B)

Solution (Python):
x=int(input())
A=0
B=0
for a in range(-120, 120):
    a5 = a**5
    for b in range(-120, 120):
        if a5 - b**5 == x:
            A = a
            B = b
            break
print(A,B)

Solution (Python):
x = int(input())
lst = [(pow(i, 5), i) for i in range(-200, 200)]
for i in range(len(lst)):
    for j in range(len(lst)):
        if lst[j][0] - lst[i][0] == x:
            print(lst[j][1], lst[i][1])
            exit()

Solution (Python):
x=int(input())
A=0
B=0
for a in range(-120,120):
    for b in range(-500,500):
        if a**5-b**5==x:
            A=a
            B=b
            break
print(A,B)

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

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

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

Solution (Python):

x=int(input())
A=0
B=0
for a in range(-500,500):
    for b in range(-500,500):
        if a**5-b**5==x:
            A=a
            B=b
            break
print(A,B)

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
INF = 10**10
MOD = 10**9 + 7
X = int(input())
MAX_X = 10**9
n = 0
while(1):
    n+=1
    if n**5 - (n-1)**5 > MAX_X:
        break
for i in range(n):
    
    for j in range(-64,n-1):
        if i**5 - j**5 == X:
            print (i,j)
            exit()

Solution (Python):







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

if __name__ == "__main__":
    main()

Solution (Python):
import math
from collections import defaultdict
 
def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res

x = readInt()

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

Solution (Python):
import sys

sys.setrecursionlimit(1000000)


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

    for i in range(-119, 121):
        a5 = i**5
        for j in range(-120, 120):
            b5 = j ** 5
            if a5 - b5 == x:
                print(str(i) + " " + str(j))
                return


main()

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


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

Solution (Python):
def f(x):
    return pow(x, 5) - pow(x - 1, 5)


x = int(input())

a_mx = 1
while f(a_mx) < x:
    a_mx += 1

a_mn = 0
while f(a_mn) < x:
    a_mn -= 1

b_mx = a_mx - 1
b_mn = a_mn - 1

for a in range(a_mn, a_mx + 1):
    for b in range(b_mn, b_mx + 1):
        if pow(a, 5) - pow(b, 5) == x:
            print(a, b)
            exit()

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

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

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 a in range(-200,200):
  for b in range(-200,200):
    if(X==a**5-b**5):
      print(a,b)
      exit()

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

  
  for a in range(-188, 200):
      for b in range(-199, 118):
          if pow(a, 5) - pow(b, 5) == x:
              print(a, b)
              break
      else:
          continue
      break


if __name__ == '__main__':
  main()

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

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

Solution (Python):
MIN = -119
MAX = 120
def calc(A, B):
    return A**5 - B**5

def main():
    X = int(input())
    for i in range(MIN, MAX+1, 1):
        for j in range(MIN, MAX+1, 1):
            if(X == calc(i, j)):
                print(*(i, j))
                return
main()

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

Solution (Python):
import sys
from math import ceil, sqrt
def input(): return sys.stdin.readline().strip()


def main():
    X = int(input())
    """
    
    
    x = int(X ** (1/5))
    if x == X ** (1/5):
        print("{} {}".format(x, 0))
        return
    
    """
    x = round(X ** (1/5))
    if x ** 5 == X:
        print("{} {}".format(x, 0))
        return
    
    for B in range(1, x + 1):
        """
        
        A = (X - B**5) ** (1/5)
        if A < B: break
        if int(A) == A:
            print("{} {}".format(int(A), -B))
            return
        """
        A = round((X - B**5) ** (1/5))
        if A < B: break
        if A ** 5 + B ** 5 == X:
            print("{} {}".format(int(A), -B))
            return
    
    """
    ここも修正
    y = sqrt(X)
    if int(y) == y:
    """
    y = round(sqrt(X))
    if y ** 2 == X:
        upper = y + 1
    else:
        upper = y

    for d in range(1, upper):
        if X % d == 0:
            B = 1
            while (B + d) ** 5  < B ** 5 + X:
                B += 1
            if (B + d) ** 5 == B ** 5 + X:
                print("{} {}".format(B + d, B))
                return
            
            e = X // d
            B = 1
            while (B + e) ** 5  < B ** 5 + X:
                B += 1
            if (B + e) ** 5 == B ** 5 + X:
                print("{} {}".format(B + e, B))
                return
       


if __name__ == "__main__":
    main()

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))
    else:
        continue
    break

Solution (Python):
import math
from collections import defaultdict
ml=lambda:map(int,input().split())
ll=lambda:list(map(int,input().split()))
ii=lambda:int(input())
ip=lambda:(input())

"""========main code==============="""
def fast(a,b):
    res=1
    while(b>0):
        if(b&1):
            res*=a
        a*=a    
        b>>=1
    return res
x=ii()
f=0
for i in range(-2001,2001):
    k=fast(i,5)
    for j in range(i,2001):
        p=fast(j,5)
        
        if((p-k)==x):
            print(j,i)
            f=1
            break
        elif(k-p==x):
            print(i,j)
            f=1
            break
    if f:
        break

Solution (Python):
import math
from collections import defaultdict
ml=lambda:map(int,input().split())
ll=lambda:list(map(int,input().split()))
ii=lambda:int(input())
ip=lambda:(input())

"""========main code==============="""
def fast(a,b):
    res=1
    while(b>0):
        if(b&1):
            res*=a
        a*=a    
        b>>=1
    return res
x=ii()
f=0
for i in range(-201,201):
    k=fast(i,5)
    for j in range(i,201):
        p=fast(j,5)
        
        if((p-k)==x):
            print(j,i)
            f=1
            break
        elif(k-p==x):
            print(i,j)
            f=1
            break
    if f:
        break

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
INF = 10**10
MOD = 10**9 + 7
X = int(input())
MAX_X = 10**9
n = 0
while(1):
    n+=1
    if n**5 - (n-1)**5 > MAX_X:
        break
for i in range(n):
    for j in range(-n+1,n-1):
        if i**5 - j**5 == X:
            print (i,j)
            exit()

Solution (Python):

from itertools import*
x=int(input());r=range(-200,200)
for a,b in product(r,r):
 if a**5-b**5==x:print(a,b);exit()

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

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

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

Solution (Python):
x=int(input())
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())

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

bf(x)