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(-1000, 1001):
    for j in range(-1000, 1001):
        if i**5 - j**5 == X:
            print(i, j)
            exit()

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

X = int(readline().rstrip())

lim = 0
N = 0
while True:
    N += 1
    tmp = (N ** 5) - (N - 1) ** 5
    if tmp > X:
        lim = N
        break

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

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


def factorize(n):
    res = list()
    i = 2
    while i*i <= n:
        if n%i == 0:
            c = 0
            while n%i == 0:
                n /= i
                c += 1
            res.append([i,c])
        i += 1
    if n != 1:
        res.append([n,1])
    return res

for a in range(-200,200+1):
    a5 = a**5
    b5 = a5 - X
    sign = 1
    if b5 < 0:
        b5 = -b5
        sign = -1

    pc = factorize(b5)

    b = 1
    if b5 == 0: b = 0
    for p,c in pc:
        if c == 5:
            b *= p
        else:
            break

    if b**5 == b5:
        print(a, sign*b)
        break

Solution (Python):
x = int(input())
done=False
l=6200
for a in range(-l,l+1):
  for b in range(-l,l+1):
    if(not done and a**5-b**5==x):
      print(a,b)
      done=True

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


def factorize(n):
    res = list()
    i = 2
    while i*i <= n:
        if n%i == 0:
            c = 0
            while n%i == 0:
                n /= i
                c += 1
            res.append([i,c])
        i += 1
    return res


for a in range(-200,200+1):
    a5 = a**5
    b5 = a5 - X
    sign = 1
    if b5 < 0:
        b5 = -b5
        sign = -1

    pc = factorize(b5)

    b = 1
    if b5 == 0: b = 0
    for p,c in pc:
        if c == 5:
            b *= p
        else:
            break

    if b**5 == b5:
        print(a, sign*b)
        break

Solution (Python):
x = int(input())
done=False
for a in range(-6000,6001):
  for b in range(-6000,6001):
    if(not done and a**5-b**5==x):
      print(a,b)
      done=True

Solution (Python):
import sys
input = lambda:sys.stdin.readline().strip()
x = int(input())
ok = False
for a in range(120):
    for b in range(-120,a):
        if a**5-b**5==x:
            print(a,b)
            ok = True
            break 
    if ok:
        break

Solution (Python):
x = int(input())
done=False
for a in range(-5000,5001):
  for b in range(-5000,5001):
    if(not done and a**5-b**5==x):
      done=True
      print(a,b)

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

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

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

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

Solution (Python):
from itertools import combinations
import numpy as np
import math
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

divisors = make_divisors(X)

for d in divisors:
    f = lambda x: (x + d) ** 5 - x ** 5
    if f(d / -2) <= X and f(10 ** 3) > X:
        ok = d / -2
        ng = 10 ** 3
        for _ in range(100):
            c = (ok + ng) / 2
            if f(c) <= X:
                ok = c
            else:
                ng = c
        if math.isclose(ok, round(ok)):
            print(round(ok) + d, round(ok))
            exit()
    if f(d / -2) <= X and f(-10 ** 3) > X:
        ok = d / -2
        ng = -10 ** 3
        for _ in range(100):
            c = (ok + ng) / 2
            if f(c) <= X:
                ok = c
            else:
                ng = c
        if math.isclose(ok, round(ok)):
            print(round(ok) + d, round(ok))
            exit()

Solution (Python):
import sys, math
x = int(sys.stdin.readline())

L = [i**5 for i in range(10000)]
flag = False
for i in range(10000):
    for j in range(10000):
        if L[i] - L[j]==x:
            print(i, j)
            flag = True
            break
        elif L[i] + L[j]==x:
            print(i, -j)
            flag = True
            break
    if flag ==True:
        break
else:
    print('No')

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

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

for a in range(301):
    aa = pow(a,5) - x
    for b in range(301):
        if aa == pow(b,5):
            print(a,b)
            exit()

        if -aa == pow(b,5):
            print(a,-b)
            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):
n = int(input())

for i in range(-118,120):
  for j in range(-118,120):
    if pow(i, 5) - pow(j, 5) == n:
      print(i,j)
      quit()

Solution (Python):
from sys import stdin
x = int(stdin.readline().rstrip())

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

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

ans = [0,0]
for i in range(-500,500):
  for j in range(-500,500):
    if i**5 - j**5 == X:
      ans[0] = i
      ans[1] = j
      break

ans = " ".join(map(str,ans))
print(ans)

Solution (Python):




x = int(input())

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

Solution (Python):
def sol(n):
    d = {}
    N = 1000
    for i in xrange(-N, N+1):
        d[i**5]=i
    for i in d:
        j = n+i
        if j in d:
            print d[j], d[i]
            return

def main():
    n = input()
    sol(n)
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())
def add(a,b):
  return a**4+a**3*b+a**2*b**2+a*b**3+b**4
for i in range(-118,120):
  for j in range(-118,120):
    if (i-j)*add(i,j) == X:
      print(i,j)
      quit()

Solution (Python):
x = int(input())
for a in range(-300,301):
  if(a<0):
    for b in range(-300,a):
      if(a**5-b**5==x):
        print(a,b)
        break
    else: continue
    break
  else:
    for b in range(-300,a):
      if(a**5-b**5==x):
        print(a,b)
        break
    else: continue
    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(0)

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

Solution (Python):
x = int(input())
A = 0
B = 0
for i in range(-1000,1000):
  if i**5 + x >= 0 and float.is_integer(round((i**5 + x)**0.2,5)) == True:
    A = (i**5 + x)**0.2
    B = i
    break

print(int(A),B)

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

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):
from __future__ import print_function

import sys
sys.setrecursionlimit(500000)

import re
import array
import copy
import functools
import operator

import math
import string
import fractions
from fractions import Fraction

import collections
import itertools
import bisect

import random
import time

import heapq
from heapq import heappush
from heapq import heappop
from heapq import heappushpop
from heapq import heapify
from heapq import heapreplace
from queue import PriorityQueue as pq
from queue import Queue

from itertools import accumulate

from collections import deque
from collections import Counter

from operator import mul
from functools import reduce

input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return


















def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom


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

    
    for a in range(0,200):
        for b in range(0,a+1):
            if a**5 - b**5 ==x:
                print(a,b)
                return

    
    for a in range(0,100):
        for b in range(-100,1):
            if a**5 - b**5 == x:
                print(a,b)
                return


if __name__ == '__main__':
    main()

Solution (Python):
from __future__ import print_function

import sys
sys.setrecursionlimit(500000)

import re
import array
import copy
import functools
import operator

import math
import string
import fractions
from fractions import Fraction

import collections
import itertools
import bisect

import random
import time

import heapq
from heapq import heappush
from heapq import heappop
from heapq import heappushpop
from heapq import heapify
from heapq import heapreplace
from queue import PriorityQueue as pq
from queue import Queue

from itertools import accumulate

from collections import deque
from collections import Counter

from operator import mul
from functools import reduce

input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return


















def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom


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

    
    for a in range(0,2000):
        for b in range(0,a+1):
            if a**5 - b**5 ==x:
                print(a,b)
                return

    
    for a in range(0,100):
        for b in range(-100,1):
            if a**5 - b**5 == x:
                print(a,b)
                return


if __name__ == '__main__':
    main()

Solution (Python):
X=int(input())
for a in range(-118,120):
  for b in range(-118,a+1):
    if a**5-b**5==X:
      print("%s %s" % (a,b))
      exit()

Solution (Python):
from copy import deepcopy
from sys import exit,setrecursionlimit
import math
from collections import defaultdict,Counter,deque
from fractions import Fraction as frac
import fractions
from functools import reduce
from operator import mul
import bisect
import sys
import logging
import heapq
import itertools

logging.basicConfig(level=logging.ERROR)



setrecursionlimit(1000000)


def main():
    x = int(input())
    for a in range(-200,201):
        for b in range(-200,201):
            if(a**5-b**5 == x):
                print(a,b)
                return

main()

Solution (Python):
from __future__ import print_function

import sys
sys.setrecursionlimit(500000)

import re
import array
import copy
import functools
import operator

import math
import string
import fractions
from fractions import Fraction

import collections
import itertools
import bisect

import random
import time

import heapq
from heapq import heappush
from heapq import heappop
from heapq import heappushpop
from heapq import heapify
from heapq import heapreplace
from queue import PriorityQueue as pq
from queue import Queue

from itertools import accumulate

from collections import deque
from collections import Counter

from operator import mul
from functools import reduce

input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return


















def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom


def main():
    x = int(input().strip())
    for a in range(0,2000):
        for b in range(-100,2000):
            if a**5 - b**5 == x:
                print(a,b)
                return


if __name__ == '__main__':
    main()

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

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

Solution (Python):
def check(v):
    l = int(-1e18)
    r = int(1e18)
    while r - l > 1:
        m = int((r + l) / 2)
        if m ** 5 > v:
            r = m
        else:
            l = m
    return l

x = int(input())
for b in range(-10000, 10000):
    v = int(b ** 5 + x)
    k = check(v)
    if k ** 5 == v:
        print(k, b)
        break

Solution (Python):


X = int(input())
for i in range(-120, 120):
    for j in range(-120, 120):
        if(i**5 - j**5)==X:
            print(i,j)
            break
    else:
        continue
    break

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):
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):
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):
import sys
s = int(input())
for i in range(-120,120):
  for j in range(-120,120):
    if i**5 - j**5 == s:
      print(i,j)
      sys.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(str(A)+" "+str(B))
      exit()

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

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

for A in range(-10**3,10**3):
    for B in range(-10**3,10**3):
        if A ** 5 - B ** 5 == x:
            print(A,B)
            quit()

Solution (Python):
import sys
X = int(input())
for i in range(-120,120):
  for j in range(-120,120):
    if i**5 - j **5 == X:
      print(str(i)+" "+str(j))
      sys.exit()

Solution (Python):
import sys

X= int(input())



a = 1
b = 0
dif = 0
while dif < 10**9:
    a += 1
    b += 1

    dif = a ** 5 - b ** 5

loop_sequence = a - 1

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

Solution (Python):
x = int(input())
import math
f = 1
for A in range(-10**5,10**5):
    A5 = A ** 5
    if x - A5 > 0:
        f = -1
        B = round(math.pow(x - A5,1/5),0)
    else:
        B = round(math.pow(-(x - A5),1/5),0)
    if  A5 == x + int(B*f) ** 5:
        print(A,int(B)*f)
        quit()

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

a = 0
while True:
    b = a
    target = (a**5) - X
    while (b**5) > target:
        b-=1
    if(b**5) == target:
        print("%d %d"%(a,b))
        break
    a+=1

Solution (Python):
import sys

if __name__ == "__main__":
    line1 = sys.stdin.readline().strip()
    X = int(line1)

    A = 120
    while A >= -120:
        A -= 1

        B = 120

        isEnd = False
        while B >= -120:
            B -= 1

            if A ** 5 - B ** 5 == X:
                print("{0} {1}".format(A, B))
                isEnd = True
                break

        if isEnd:
            break

Solution (Python):
import sys

def divisors(n):
  res = set()
  for i in range(1, int(n ** 0.5) + 1):
    if n % i: continue
    res.add(i)
    res.add(n // i)
  return res

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

def f(a, b): return pow(a, 5) - pow(b, 5)

def ternary_search(d):
    lo, hi = -1, 10 ** 18
    while lo + 1 < hi:
        a = (lo + hi) // 2 
        b = a - d 
        bl = a >= abs(b)
        bl2 = f(a, b) >= x
        if bl ^ bl2: lo = a
        else: hi = a
    return hi, hi - d

def main():
    diffs = divisors(x)
    for d in diffs:
        a, b = ternary_search(d)
        if f(a, b) == x:
            print(a, b)
            return 

if __name__ == '__main__':
    main()

Solution (Python):

import sys
from math import pow


def solve(X: int):
    def func(A):
        return pow(X+A**5, 1/5)

    for A in range(-1000, 1000):
        for B in range(-1000, 1000):
            if X == A**5-B**5:
                print(A, B)
                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
from math import pow


def solve(X: int):
    def func(A):
        return pow(X+A**5, 1/5)

    for A in range(-1000, 1000):
        for B in range(-1000, 1000):
            if X == A**5-B**5:
                print(A, B)
                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):
n = int(input())
flag = False
for i in range(10**8):
    for j in range(-10**4,10**4):
        if i**5 - j **5 == n :
            print(i,j)
            flag = True
            break
    if flag == True :
        break

Solution (Python):

import sys
from math import pow


def solve(X: int):
    def func(A):
        return pow(X+A**5, 1/5)

    for A in range(-200, 200):
        for B in range(-200, 200):
            if X == A**5-B**5:
                print(A, B)
                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):
x = int(input())
for i in range(-118, 120):
  for j in range(-119, 119):
    if i**5 - j**5 == x:
      print(i, j)
      exit(0)

Solution (Python):
X = int(input())
A = 0
B = 1010
while B==1010:
    l = -1000
    r = 1000
    while abs(l-r)!=1:
        if A**5-((l+r)//2)**5<X:
            r = (l+r)//2
        elif A**5-((l+r)//2)**5>X:
            l = (l+r)//2
        else:
            B = (l+r)//2
            break
    if B==1010:
        A += 1
print(A,B)

Solution (Python):
import sys

def divisors(n):
  res = set()
  for i in range(1, int(n ** 0.5) + 1):
    if n % i: continue
    res.add(i)
    res.add(n // i)
  return res

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

def f(a, b):
    return pow(a, 5) - pow(b, 5)

def binary(d):
    lo, hi = -1, 10 ** 18
    while lo + 1 < hi:
        a = (lo + hi) // 2 
        b = a - d 
        bl = a >= abs(b)
        bl2 = f(a, b) >= x
        if bl ^ bl2: lo = a
        else: hi = a

        
        
        
        
    return hi, hi - d

def main():
    diffs = divisors(x)
    for d in diffs:
        a, b = binary(d)
        if f(a, b) == x:
            print(a, b)
            return 

if __name__ == '__main__':
    main()

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


p = factorization(x)
p = make_divisors(x)

Bas = 0
Aas = 0

flg = False


for i in range(len(p)):
    if flg:
        break
    _p = p[i]
    
    B = int(-_p/2)

    while True:

        xnew = (B + _p)**5 - B ** 5
        
        if xnew == x:
            Bas = B
            Aas = B + _p
            flg = True
            break

        if xnew > x:
            break

        B += 1


print(f'{Aas} {Bas}')

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

Solution (Python):
from math import floor,ceil,sqrt
import fractions
import collections
import itertools
from collections import deque
X=int(input())
"""
l=[]
for i in range(1,ceil(sqrt(X))+1):
    if X%i==0:
        l.append(i)
        l.append(X//i)
l=list(set(l))
l2=l
for i in range(len(l)):
    l2.append(-l[i])

l2.sort()
if len(l)!=0:
    for i in l2:
        x=X//i
        
        n=(x-pow(i,4))/(pow(i,2)+1)
        
        if (5*pow(i,4)+20*x)>=0:
            if sqrt((5*pow(i,4)+20*x)).is_integer()==True:
                
                m=int(sqrt((5*pow(i,4)+20*x)))
                if (-5*i*i+m)%10==0:
                    y=(-5*i*i+m)//10
                    
                    if pow(i,2)+4*y>=0:
                        if sqrt(pow(i,2)+4*y).is_integer()==True:
                            z=int(sqrt(pow(i,2)+4*y))
                            if (-i+z)%2==0:
                                b=(-i+z)//2
                                a=i+b
                                print(a,b)
                                break
                            elif (-i - z) % 2 == 0:
                                b = (-i - z) // 2
                                a = i + b
                                print(a, b)
                                break
                elif (-5*i*i-m)%10==0:
                    y=(-5*i*i+m)//10
                    
                    if pow(i,2)+4*y>=0:
                        if sqrt(pow(i,2)+4*y).is_integer()==True:
                            z=int(sqrt(pow(i,2)+4*y))
                            if (-i+z)%2==0:
                                b=(-i+z)//2
                                a=i+b
                                print(a,b)
                                break
                            elif (-i - z) % 2 == 0:
                                b = (-i - z) // 2
                                a = i + b
                                print(a, b)
                                break
"""
flag=0









i=0
while pow(i+1,5)-pow(i,5)<10**9:        
    
    i=i+1
ma=i

i=0

while pow(i,5)-pow(i-1,5)<10**9:        
    
    i=i-1
mi=i

for i in range(mi-2,ma+2):          
    for j in range(mi-2,ma+2):      
        if pow(i,5)-pow(j,5)==X:
            print(i,j)
            flag=1
            break
    if flag==1:
        break

Solution (Python):
from sys import stdin


def get_result(data):
    N = data[0]
    for a in range(-1000, 1000):
        for b in range(-1000, 1000):
            if (a**5 - b**5) == N:
                return '{} {}'.format(a, b)


if __name__ == '__main__':
    data = list(map(int, stdin.readline().rstrip().split(' ')))
    result = get_result(data)
    print(result)

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


N=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

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

L=make_divisors(N)
for yakusu in L:
    for a in range(10**3):
        b=a-yakusu
        if func(a,b)==N:
            print a,b
            quit()

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

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

Solution (Python):
import itertools

X = int(input())


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


A, B = solve(X)
print(A, B)

Solution (Python):


N=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

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

L=make_divisors(N)
for yakusu in L:
    for a in range(1,10**3):
        b=a-yakusu
        if func(a,b)==N:
            print a,b
            quit()

Solution (Python):
def main():
    r = 0
    x = 0
    while x <= 1e9:
        r += 1
        x = pow(r, 5) - pow(r-1, 5)
    x = 0
    l = 1
    while x <= 1e9:
        l -= 1
        x = pow(l, 5) - pow(l-1, 5)
    for a in range(l,r):
        for b in range(l,r):
            if pow(a,5) - pow(b, 5) == X:
                print(a, b)
                return

X = int(input())
main()

Solution (Python):


N=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

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

L=make_divisors(N)
for yakusu in L:
    for a in range(1,10**3):
        b=a-yakusu
        ret=func(a,b)
        if ret==N:
            print a,b
            quit()

Solution (Python):


N=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

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

L=make_divisors(N)
for yakusu in L:
    for a in range(1,10**3):
        b=a-yakusu
        ret=func(a,b)
        if ret==N:
            print a,b
            quit()

Solution (Python):

import sys


def solve(X: int):
    f = lambda x, y: x**5 - y**5
    for i in range(-200, 200):
        for j in range(-200, 200):
            if f(i, j) == X:
                print(str(i) + ' ' + str(j))
                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

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


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

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


if __name__ == '__main__':
    main()

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

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()
    save = -1
    for i in range(len(divisors)):
        if divisors[i] >= 130:
            save = i
            break
    if save > 0:
        divisors = divisors[:save]
    return divisors

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

divs = make_divisors(X)
ans = 0
for div in divs:
  a = -120+div
  b = -120
  while f(a, b) > X and b < 2:
    a += 1
    b += 1
  if f(a, b) == X:
    ans = (a, b)
    
print(ans[0], ans[1])

Solution (Python):



X = int(input()) 





count = 0
for l in range(-1000,1000):
  for i in range(-1000,1000):
    if(l**5 -i**5 == X):
      print(l,i)
      count += 1
      break
  if(count == 1):
    break

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

Solution (Python):
from sys import stdin, setrecursionlimit

setrecursionlimit(10 ** 9)


def input():
    return stdin.readline().strip()

X = int(input())
for A in range(-10 ** 3, 10 ** 3):
    A5 = A ** 5
    for B in range(-10 ** 3, 10 ** 3):
        if A5 - B ** 5 == X:
            print(A, B)
            exit()

Solution (Python):
x = int(input())
for i in range(120):
    for j in range(120):
        A = i**5
        B = j**5
        if x == A+B:
            print(i,-j)
            exit()
        elif x == A-B:
            print(i, j)
            exit()

Solution (Python):
from sys import stdin, setrecursionlimit

setrecursionlimit(10 ** 9)


def input():
    return stdin.readline().strip()

X = int(input())
for A in range(-10 ** 3, 10 ** 3):
    A5 = A ** 5
    for B in range(-10 ** 3, 10 ** 3):
        if A5 - B ** 5 == X:
            print(A, B)
            exit()

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)
    divisors.sort()
    save = -1
    for i in range(len(divisors)):
        if divisors[i] >= 130:
            save = i
            break
    if save > 0:
        divisors = divisors[:save]
    return divisors

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

divs = make_divisors(X)
ans = 0
for div in divs:
  a = -120
  b = -120+div
  while f(a, b) < X and a < 2:
    a += 1
    b += 1
  if f(a, b) == X:
    ans = (a, b)
  a = -120+div
  b = -120
  while f(a, b) > X and b < 2:
    a += 1
    b += 1
  if f(a, b) == X:
    ans = (a, b)
    
print(ans[0], ans[1])

Solution (Python):


N=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

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

L=make_divisors(N)
for yakusu in L:
    for a in range(10**3):
        b=a-yakusu
        if func(a,b)==N:
            print a,b
            quit()