Buggy python submission (verdict: Time Limit Exceeded):
X = int(input())

for a in range(1 , 10**3 , 1):
  A = a**5
  for b in range(0 , X+1 , 1):
    B = b**5
    if(A-B==X):
      print(a, b)
      exit()
    else:
      continue
      
for a in range(0 , 10**3 , 1):
  A = a**5
  for b in range(0 , -X-1 , -1):
    B = b**5
    if(A-B==X):
      print(a, b)
      exit()
    else:
      continue

Fixed submission:
X = int(input())
 
for a in range(-119 , 120 , 1):
  A = a**5
  for b in range(-119 , 120 , 1):
    B = b**5
    if(A-B==X):
      print(a, b)
      exit()
    else:
      continue

Buggy python submission (verdict: Time Limit Exceeded):
X = int(input())

for a in range(0 , 10**2 , 1):
  for b in range(0 , X+1 , 1):
    if(a**5-b**5==X):
      print(a, b)
      exit()
    else:
      continue
      
for a in range(0 , 10**2 , 1):
  for b in range(0 , -X , -1):
    if(a**5-b**5==X):
      print(a, b)
      exit()
    else:
      continue

Fixed submission:
X = int(input())
 
for a in range(-119 , 120 , 1):
  A = a**5
  for b in range(-119 , 120 , 1):
    B = b**5
    if(A-B==X):
      print(a, b)
      exit()
    else:
      continue

Buggy python submission (verdict: Time Limit Exceeded):
X = int(input())

for a in range(0 , 10**3 , 1):
  for b in range(0 , X+1 , 1):
    if(a**5-b**5==X):
      print(a, b)
      exit()
    else:
      continue
      
for a in range(0 , 10**3 , 1):
  for b in range(0 , -X , -1):
    if(a**5-b**5==X):
      print(a, b)
      exit()
    else:
      continue

Fixed submission:
X = int(input())
 
for a in range(-119 , 120 , 1):
  A = a**5
  for b in range(-119 , 120 , 1):
    B = b**5
    if(A-B==X):
      print(a, b)
      exit()
    else:
      continue

Buggy python submission (verdict: Time Limit Exceeded):
X = int(input())

for a in range(0 , 10**4 , 1):
  for b in range(0 , X+1 , 1):
    if(a**5-b**5==X):
      print(a, b)
      exit()
    else:
      continue
      
for a in range(0 , 10**4 , 1):
  for b in range(0 , -X , -1):
    if(a**5-b**5==X):
      print(a, b)
      exit()
    else:
      continue

Fixed submission:
X = int(input())
 
for a in range(-119 , 120 , 1):
  A = a**5
  for b in range(-119 , 120 , 1):
    B = b**5
    if(A-B==X):
      print(a, b)
      exit()
    else:
      continue

Buggy python submission (verdict: Time Limit Exceeded):
X = int(input())
a = 1
b = 1
while True:  
  if(a**5 - b**5 == X):
    print(a , b)
    break
  a += 1
  for i in range(X):
    b += 1
    if(a**5 - b**5 == X):
      print(a , b)
      exit()
while True:
  if(a**5 - b**5 == X):
    print(a , b)
    break
  b -= 1
  for j in range(X):
    b -= 1
    if(a**5 - b**5 == X):
      print(a , b)
      exit()

Fixed submission:
X = int(input())
 
for a in range(-119 , 120 , 1):
  A = a**5
  for b in range(-119 , 120 , 1):
    B = b**5
    if(A-B==X):
      print(a, b)
      exit()
    else:
      continue

Buggy python submission (verdict: Time Limit Exceeded):
X = int(input())
a = 1
b = 1
while True:
  if(a**5 - b**5 == X):
    print(a , b)
    break
  a += 1
  b += 1
while True:
  if(a**5 - b**5 == X):
    print(a , b)
    break
  a += 1
  b -= 1

Fixed submission:
X = int(input())
 
for a in range(-119 , 120 , 1):
  A = a**5
  for b in range(-119 , 120 , 1):
    B = b**5
    if(A-B==X):
      print(a, b)
      exit()
    else:
      continue