Buggy python submission (verdict: Runtime Error):
X = int(input())

p = [0]*1000

flag = False
for i in range(1000):
    p[i] = i**5

for i in range(1,1000):
    for j in range(1,1000):
        if p[i]-p[j] == X:
            a = i
        
            b = j
            flag=True
        if p[i] + p[j] ==X:
            a=i
            b=-j
            flag=True


        if flag:
            break
    if flag:
        break

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


Fixed submission:
X=int(input())
A=0
B=0
flag = False
for a in range(120):
    for b in range(120):
        if a**5 - b**5 == X:
            A=a
            B=b
            flag = True

        if a ** 5 + b**5 == X:
            A=a
            B=-b

        if -a**5 + b**5 ==X:
            A =-a
            B = b

        if flag:
            break
    if flag:
        break
print(str(A)+" "+str(B))

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

stack = [[0,0]]
i = 0
def bfs(a,b):
    global stack
    global X
    
    if a**5 - b**5== X:
        return True
    
    elif a**5 - b**5 > X:
        stack.append([a,b+1])
        stack.append([a-1,b])
        return False
    elif a**5 - b**5 < X:
        stack.append([a+1,b])
        stack.append([a,b-1])
        return False

while len(stack) > i:
    if bfs(stack[i][0],stack[i][1]):
        print(str(stack[i][0]) +" "+str(stack[i][1]))
        break
    
    i+=1
    




Fixed submission:
X=int(input())
A=0
B=0
flag = False
for a in range(120):
    for b in range(120):
        if a**5 - b**5 == X:
            A=a
            B=b
            flag = True

        if a ** 5 + b**5 == X:
            A=a
            B=-b

        if -a**5 + b**5 ==X:
            A =-a
            B = b

        if flag:
            break
    if flag:
        break
print(str(A)+" "+str(B))

Buggy python submission (verdict: Runtime Error):
X = int(input())

p = [0]*1000

flag = False
for i in range(1000):
    p[i] = i**5

for i in range(1,1000):
    for j in range(1,1000):
        if p[i]-p[j] == X or flag:
            a = i
        
            b = j
            flag=True
        if p[i] + p[j] ==X or flag:
            a=i
            b=-j
            flag=True
        if flag:
            break
    if flag:
        break

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


Fixed submission:
X=int(input())
A=0
B=0
flag = False
for a in range(120):
    for b in range(120):
        if a**5 - b**5 == X:
            A=a
            B=b
            flag = True

        if a ** 5 + b**5 == X:
            A=a
            B=-b

        if -a**5 + b**5 ==X:
            A =-a
            B = b

        if flag:
            break
    if flag:
        break
print(str(A)+" "+str(B))

Buggy python submission (verdict: Runtime Error):
X = int(input())

p = [0]*100

flag = False
for i in range(100):
    p[i] = i**5

for i in range(1,100):
    for j in range(1,100):
        if p[i]-p[j] == X or flag:
            a = i
        
            b = j
            flag=True
        if p[i] + p[j] ==X or flag:
            a=i
            b=-j
            flag=True
        if flag:
            break
    if flag:
        break

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


Fixed submission:
X=int(input())
A=0
B=0
flag = False
for a in range(120):
    for b in range(120):
        if a**5 - b**5 == X:
            A=a
            B=b
            flag = True

        if a ** 5 + b**5 == X:
            A=a
            B=-b

        if -a**5 + b**5 ==X:
            A =-a
            B = b

        if flag:
            break
    if flag:
        break
print(str(A)+" "+str(B))

Buggy python submission (verdict: Runtime Error):
X = int(input())

p = [0]*100

flag = False
for i in range(100):
    p[i] = i**5

for i in range(1,100):
    for j in range(1,100):
        if p[i]-p[j] == X or flag:
            a = i
        
            b = j
            flag=True
        if p[i] + p[j] ==X or flag:
            a=i
            b=-j
            flag=True
        if flag:
            break
    if flag:
        break
            
print(flag)
print(str(a)+" "+str(b))


Fixed submission:
X=int(input())
A=0
B=0
flag = False
for a in range(120):
    for b in range(120):
        if a**5 - b**5 == X:
            A=a
            B=b
            flag = True

        if a ** 5 + b**5 == X:
            A=a
            B=-b

        if -a**5 + b**5 ==X:
            A =-a
            B = b

        if flag:
            break
    if flag:
        break
print(str(A)+" "+str(B))

Buggy python submission (verdict: Runtime Error):
X = int(input())

p = [0]*100

flag = False
for i in range(100):
    p[i] = i**5

for i in range(100):
    for j in range(100):
        if p[i]-p[j] == X or flag:
            a = i
        
            b = j
            flag=True
        if p[i] + p[j] ==X or flag:
            a=i
            b=-j
            flag=True
        if flag:
            break
    if flag:
        break
            
print(str(a)+" "+str(b))


Fixed submission:
X=int(input())
A=0
B=0
flag = False
for a in range(120):
    for b in range(120):
        if a**5 - b**5 == X:
            A=a
            B=b
            flag = True

        if a ** 5 + b**5 == X:
            A=a
            B=-b

        if -a**5 + b**5 ==X:
            A =-a
            B = b

        if flag:
            break
    if flag:
        break
print(str(A)+" "+str(B))