Buggy python submission (verdict: Runtime Error):
import sys
from math import ceil, sqrt
def input(): return sys.stdin.readline().strip()


def main():
    X = int(input())
    x = int(X ** (1/5))
    if x == X ** (1/5):
        print("{} {}".format(x, 0))
        return
    
    for B in range(1, x + 1):
        A = (X - B**5) ** (1/5)
        if A < B: break
        if int(A) == A:
            print("{} {}".format(int(A), -B))
            return
    
    y = sqrt(X)
    if int(y) == y:
        upper = int(y) + 1
    else:
        upper = ceil(y)

    for d in range(1, upper):
        """
        if X % d == 0:
            B = 1
            while (B + d) ** 5  < B ** 5 + X:
                B += 1
            if (B + d) ** 5 == B ** 5 + X:
                print("{} {}".format(B + d, B))
                return
            
            e = X // d
            B = 1
            while (B + e) ** 5  < B ** 5 + X:
                B += 1
            if (B + e) ** 5 == B ** 5 + X:
                print("{} {}".format(B + e, B))
                return
        """
        B = 1
            while (B + d) ** 5  < B ** 5 + X:
                B += 1
            if (B + d) ** 5 == B ** 5 + X:
                print("{} {}".format(B + d, B))
                return
            
            e = X // d
            B = 1
            while (B + e) ** 5  < B ** 5 + X:
                B += 1
            if (B + e) ** 5 == B ** 5 + X:
                print("{} {}".format(B + e, B))
                return



if __name__ == "__main__":
    main()


Fixed submission:
import sys
from math import ceil, sqrt
def input(): return sys.stdin.readline().strip()


def main():
    X = int(input())
    """
    # ここで丸め誤差が出たせいで数学的にはTrueなものがFalse扱いされていた！！！
    # （例：3125**(1/5) = 5.000000000000001）
    x = int(X ** (1/5))
    if x == X ** (1/5):
        print("{} {}".format(x, 0))
        return
    # 正しくは以下：
    """
    x = round(X ** (1/5))
    if x ** 5 == X:
        print("{} {}".format(x, 0))
        return
    
    for B in range(1, x + 1):
        """
        # ここも丸め誤差が出るので修正が必要
        A = (X - B**5) ** (1/5)
        if A < B: break
        if int(A) == A:
            print("{} {}".format(int(A), -B))
            return
        """
        A = round((X - B**5) ** (1/5))
        if A < B: break
        if A ** 5 + B ** 5 == X:
            print("{} {}".format(int(A), -B))
            return
    
    """
    ここも修正
    y = sqrt(X)
    if int(y) == y:
    """
    y = round(sqrt(X))
    if y ** 2 == X:
        upper = y + 1
    else:
        upper = y

    for d in range(1, upper):
        if X % d == 0:
            B = 1
            while (B + d) ** 5  < B ** 5 + X:
                B += 1
            if (B + d) ** 5 == B ** 5 + X:
                print("{} {}".format(B + d, B))
                return
            
            e = X // d
            B = 1
            while (B + e) ** 5  < B ** 5 + X:
                B += 1
            if (B + e) ** 5 == B ** 5 + X:
                print("{} {}".format(B + e, B))
                return
       


if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
from math import ceil, sqrt
def input(): return sys.stdin.readline().strip()


def main():
    X = int(input())
    x = int(X ** (1/5))
    if x == X ** (1/5):
        print("{} {}".format(x, 0))
        return
    
    for B in range(x + 1):
        A = (X - B**5) ** (1/5)
        if int(A) == A:
            print("{} {}".format(int(A), -B))
            return
    
    B = 1
    while True:
        n = X + B ** 5
        A = n ** (1/ 5)
        if A == int(A):
            print("{} {}".format(int(A), B))
            return
        else:
            B += 1



if __name__ == "__main__":
    main()


Fixed submission:
import sys
from math import ceil, sqrt
def input(): return sys.stdin.readline().strip()


def main():
    X = int(input())
    """
    # ここで丸め誤差が出たせいで数学的にはTrueなものがFalse扱いされていた！！！
    # （例：3125**(1/5) = 5.000000000000001）
    x = int(X ** (1/5))
    if x == X ** (1/5):
        print("{} {}".format(x, 0))
        return
    # 正しくは以下：
    """
    x = round(X ** (1/5))
    if x ** 5 == X:
        print("{} {}".format(x, 0))
        return
    
    for B in range(1, x + 1):
        """
        # ここも丸め誤差が出るので修正が必要
        A = (X - B**5) ** (1/5)
        if A < B: break
        if int(A) == A:
            print("{} {}".format(int(A), -B))
            return
        """
        A = round((X - B**5) ** (1/5))
        if A < B: break
        if A ** 5 + B ** 5 == X:
            print("{} {}".format(int(A), -B))
            return
    
    """
    ここも修正
    y = sqrt(X)
    if int(y) == y:
    """
    y = round(sqrt(X))
    if y ** 2 == X:
        upper = y + 1
    else:
        upper = y

    for d in range(1, upper):
        if X % d == 0:
            B = 1
            while (B + d) ** 5  < B ** 5 + X:
                B += 1
            if (B + d) ** 5 == B ** 5 + X:
                print("{} {}".format(B + d, B))
                return
            
            e = X // d
            B = 1
            while (B + e) ** 5  < B ** 5 + X:
                B += 1
            if (B + e) ** 5 == B ** 5 + X:
                print("{} {}".format(B + e, B))
                return
       


if __name__ == "__main__":
    main()