Buggy python submission (verdict: Time Limit Exceeded):
# D

x = int(input())

a = int(x**(1/5))
b = int(abs(x-a**5)**(1/5))
i = 1
while True:
    if a**5 - b**5 != x and a**5 - (-b)**5 != x:
        a += i
        b = int(abs(x-a**5)**(1/5))
        if a**5 - b**5 == x:
            print(a,b)
            break
        elif a**5 - (-b)**5 == x:
            print(a,-b)
            break
        else:
            pass
        
    elif a**5 - b**5 == x:
        print(a,b)
        break

    else:
        print(a,-b)
        break

    


Fixed submission:
# D

x = int(input())

a = int(x**(1/5))
b = int(abs(x-a**5)**(1/5))
i = 1
while True:
    if a**5 - b**5 != x and a**5 - (-b)**5 != x:
        if a**5 - x > (a+1)**5 - x:
            a += i
            b = int(abs(x-a**5)**(1/5))
            if a**5 - b**5 == x:
                print(a,b)
                break
            elif a**5 - (-b)**5 == x:
                print(a,-b)
                break
            else:
                pass
        else:
            a -= 1
            b = int(abs(x-a**5)**(1/5))
            if a**5 - b**5 == x:
                print(a,b)
                break
            elif a**5 - (-b)**5 == x:
                print(a,-b)
                break
            else:
                pass
    elif a**5 - b**5 == x:
        print(a,b)
        break

    else:
        print(a,-b)
        break

Buggy python submission (verdict: Time Limit Exceeded):
# D

x = int(input())

a = int(x**(1/5))
b = int(abs(x-a**5)**(1/5))
i = 1
while True:

    if a**5 - b**5 != x and a**5 - (-b)**5 != x:
        a = int(x**(1/5))+i
        b = int(abs(x-a**5)**(1/5))
        if a**5 - b**5 == x:
            print(a,b)
            break
        elif a**5 - (-b)**5 == x:
            print(a,-b)
            break
        else:
            i += 1
        
    elif a**5 - b**5 == x:
        print(a,b)
        break

    else:
        print(a,-b)
        break

    


Fixed submission:
# D

x = int(input())

a = int(x**(1/5))
b = int(abs(x-a**5)**(1/5))
i = 1
while True:
    if a**5 - b**5 != x and a**5 - (-b)**5 != x:
        if a**5 - x > (a+1)**5 - x:
            a += i
            b = int(abs(x-a**5)**(1/5))
            if a**5 - b**5 == x:
                print(a,b)
                break
            elif a**5 - (-b)**5 == x:
                print(a,-b)
                break
            else:
                pass
        else:
            a -= 1
            b = int(abs(x-a**5)**(1/5))
            if a**5 - b**5 == x:
                print(a,b)
                break
            elif a**5 - (-b)**5 == x:
                print(a,-b)
                break
            else:
                pass
    elif a**5 - b**5 == x:
        print(a,b)
        break

    else:
        print(a,-b)
        break

Buggy python submission (verdict: Time Limit Exceeded):
# D

x = int(input())

a = int(x**(1/5))
b = int(abs(x-a**5)**(1/5))
i = 1
while True:

    if a**5 - b**5 != x and a**5 - (-b)**5 != x:
        a = int(x**(1/5))+i
        b = int(abs(x-a**5)**(1/5))
        if a**5 - b**5 == x:
            print(a,b)
            break
        elif a**5 - (-b)**5 == x:
            print(a,-b)
            break
        else:
            i += 1
        
    elif a**5 - b**5 == x:
        print(a,b)
        break

    else:
        print(a,-b)
        break

    


Fixed submission:
# D

x = int(input())

a = int(x**(1/5))
b = int(abs(x-a**5)**(1/5))
i = 1
while True:
    if a**5 - b**5 != x and a**5 - (-b)**5 != x:
        if a**5 - x > (a+1)**5 - x:
            a += i
            b = int(abs(x-a**5)**(1/5))
            if a**5 - b**5 == x:
                print(a,b)
                break
            elif a**5 - (-b)**5 == x:
                print(a,-b)
                break
            else:
                pass
        else:
            a -= 1
            b = int(abs(x-a**5)**(1/5))
            if a**5 - b**5 == x:
                print(a,b)
                break
            elif a**5 - (-b)**5 == x:
                print(a,-b)
                break
            else:
                pass
    elif a**5 - b**5 == x:
        print(a,b)
        break

    else:
        print(a,-b)
        break

Buggy python submission (verdict: Time Limit Exceeded):
# D

x = int(input())

a = int(x**(1/5))
b = int(abs(x-a**5)**(1/5))
i = 1
while True:

    if a**5 - b**5 != x and a**5 - (-b)**5 != x:
        a = int(x**(1/5))+i
        b = int(abs(x-a**5)**(1/5))
        if a**5 - b**5 == x:
            print(a,b)
            break
        elif a**5 - (-b)**5 == x:
            print(a,-b)
            break
        else:
            i += 1
        
    elif a**5 - b**5 == x:
        print(a,b)

    else:
        print(a,-b)

    


Fixed submission:
# D

x = int(input())

a = int(x**(1/5))
b = int(abs(x-a**5)**(1/5))
i = 1
while True:
    if a**5 - b**5 != x and a**5 - (-b)**5 != x:
        if a**5 - x > (a+1)**5 - x:
            a += i
            b = int(abs(x-a**5)**(1/5))
            if a**5 - b**5 == x:
                print(a,b)
                break
            elif a**5 - (-b)**5 == x:
                print(a,-b)
                break
            else:
                pass
        else:
            a -= 1
            b = int(abs(x-a**5)**(1/5))
            if a**5 - b**5 == x:
                print(a,b)
                break
            elif a**5 - (-b)**5 == x:
                print(a,-b)
                break
            else:
                pass
    elif a**5 - b**5 == x:
        print(a,b)
        break

    else:
        print(a,-b)
        break