Buggy python submission (verdict: Time Limit Exceeded):
x = int(input())
def make_divisors(n):
    divisors = [0]
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
    return divisors

flag = 0
a_s = 0
if x == 1:
  print(1, 0)
else:
  l = make_divisors(x)
  for i in range(x+1):
    if 2*(i**5) >= x:
      a_s = i
      break
  for a in range(a_s, x+1):
    if flag == 1:
      break
    for b_a in l:
      if b_a <= a:
        b = a - b_a
        if a**5 - b**5 == x:
          print(a, b)
          flag += 1
          break
        elif a**5 + b**5 == x:
          print(a, -1*b)
          flag += 1
          break
      else:
        continue

Fixed submission:
x = int(input())
def make_divisors(n):
    divisors = [0]
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
    return divisors

flag = 0
a_s = 0
if x == 1:
  print(1, 0)
else:
  l = make_divisors(x)
  for a in range(a_s, x+1):
    if flag == 1:
      break
    for b_a in l:
      if b_a <= a:
        b = a - b_a
        if a**5 - b**5 == x or a**5 + b**5 == x:
          flag += 1
          print(a, b)
          break
      if b_a > a:
        b = b_a - a
        if a**5 + b**5 == x:
          flag += 1
          print(a, -b)
          break

Buggy python submission (verdict: Time Limit Exceeded):
x = int(input())
def make_divisors(n):
    divisors = [0]
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors

flag = 0
a_s = 0
if x == 1:
  print(1, 0)
else:
  l = make_divisors(x)
  for i in range(x+1):
    if 2*(i**5) >= x:
      a_s = i
      break
  for a in range(a_s, x+1):
    if flag == 1:
      break
    for b_a in l:
      if b_a <= a:
        b = a - b_a
        if a**5 - b**5 == x:
          print(a, b)
          flag += 1
          break
        elif a**5 + b**5 == x:
          print(a, -1*b)
          flag += 1
          break
      else:
        continue

Fixed submission:
x = int(input())
def make_divisors(n):
    divisors = [0]
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
    return divisors

flag = 0
a_s = 0
if x == 1:
  print(1, 0)
else:
  l = make_divisors(x)
  for a in range(a_s, x+1):
    if flag == 1:
      break
    for b_a in l:
      if b_a <= a:
        b = a - b_a
        if a**5 - b**5 == x or a**5 + b**5 == x:
          flag += 1
          print(a, b)
          break
      if b_a > a:
        b = b_a - a
        if a**5 + b**5 == x:
          flag += 1
          print(a, -b)
          break

Buggy python submission (verdict: Time Limit Exceeded):
x = int(input())
flag = 0
a_s = 0
b_e = int((x+1)/2)
if x == 1:
  print(1, 0)
else:
  for i in range(x+1):
    if i**5 >= x:
      a_s = i
      break
  for b in range(b_e):
    if flag == 1:
      break
    for a in range(a_s-1, x+1):
      if a**5 - b**5 == x:
        print(a, b)
        flag += 1
        break
      elif a**5 + b**5 == x:
        print(a, -1*b)
        flag += 1
        break

Fixed submission:
x = int(input())
def make_divisors(n):
    divisors = [0]
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
    return divisors

flag = 0
a_s = 0
if x == 1:
  print(1, 0)
else:
  l = make_divisors(x)
  for a in range(a_s, x+1):
    if flag == 1:
      break
    for b_a in l:
      if b_a <= a:
        b = a - b_a
        if a**5 - b**5 == x or a**5 + b**5 == x:
          flag += 1
          print(a, b)
          break
      if b_a > a:
        b = b_a - a
        if a**5 + b**5 == x:
          flag += 1
          print(a, -b)
          break

Buggy python submission (verdict: Time Limit Exceeded):
x = int(input())
flag = 0
if x == 1:
  print(1, 0)
else:
  for i in range(x+1):
    a_0 = 0
    if i**5 >= x:
      a_0 = i
      break
  for a in range(a_0-1, x+1):
    if flag == 1:
      break
    for b in range(x+1):
      if a**5 - b**5 == x:
        print(a, b)
        flag += 1
        break
      elif a**5 + b**5 == x:
        print(a, -1*b)
        flag += 1
        break

Fixed submission:
x = int(input())
def make_divisors(n):
    divisors = [0]
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
    return divisors

flag = 0
a_s = 0
if x == 1:
  print(1, 0)
else:
  l = make_divisors(x)
  for a in range(a_s, x+1):
    if flag == 1:
      break
    for b_a in l:
      if b_a <= a:
        b = a - b_a
        if a**5 - b**5 == x or a**5 + b**5 == x:
          flag += 1
          print(a, b)
          break
      if b_a > a:
        b = b_a - a
        if a**5 + b**5 == x:
          flag += 1
          print(a, -b)
          break

Buggy python submission (verdict: Time Limit Exceeded):
x = int(input())
flag = 0
for a in range(x+1):
  if flag == 1:
    break
  for b in range(x+1):
    if a**5 - b**5 == x:
      print(a, b)
      flag += 1
      break
    elif a**5 + b**5 == x:
      print(a, -1*b)
      flag += 1
      break

Fixed submission:
x = int(input())
def make_divisors(n):
    divisors = [0]
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
    return divisors

flag = 0
a_s = 0
if x == 1:
  print(1, 0)
else:
  l = make_divisors(x)
  for a in range(a_s, x+1):
    if flag == 1:
      break
    for b_a in l:
      if b_a <= a:
        b = a - b_a
        if a**5 - b**5 == x or a**5 + b**5 == x:
          flag += 1
          print(a, b)
          break
      if b_a > a:
        b = b_a - a
        if a**5 + b**5 == x:
          flag += 1
          print(a, -b)
          break