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


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


p = factorization(x)
# print(p)
Bas = 0
Aas = 0
for i in range(1):
    _p = p[i][0]
    # print(_p)
    B = 0
    flg = 0
    while True:

        xnew = (B + _p)**5 - B ** 5
        # print(xnew)
        if xnew == x:
            Bas = B
            Aas = B + _p
            break
        if xnew > x:
            if flg == -1:
                B *= 10
                B = min(-_p/2, B)
            else:
                B -= 1
            flg = -1
        else:
            if flg == 1:
                B *= 10
            else:
                B += 1
            flg = 1

print(f'{Aas} {Bas}')


Fixed submission:
x = int(input())


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


def make_divisors(n):
    divisors = []
    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


p = factorization(x)
p = make_divisors(x)
# print(p)
Bas = 0
Aas = 0

flg = False
# p.append([1, 1])
# print(p)
for i in range(len(p)):
    if flg:
        break
    _p = p[i]
    # print(_p)
    B = int(-_p/2)

    while True:

        xnew = (B + _p)**5 - B ** 5
        # print(B, xnew)
        if xnew == x:
            Bas = B
            Aas = B + _p
            flg = True
            break

        if xnew > x:
            break

        B += 1


print(f'{Aas} {Bas}')

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


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


p = factorization(x)
# print(p)
Bas = 0
Aas = 0
for i in range(1):
    _p = p[i][0]
    # print(_p)
    B = 0
    flg = 0
    while True:

        xnew = (B + _p)**5 - B ** 5
        # print(xnew)
        if xnew == x:
            Bas = B
            Aas = B + _p
            break
        if xnew > x:
            if flg == -1:
                B *= 10
            else:
                B -= 1
            flg = -1
        else:
            if flg == 1:
                B *= 10
            else:
                B += 1
            flg = 1

print(f'{Aas} {Bas}')


Fixed submission:
x = int(input())


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


def make_divisors(n):
    divisors = []
    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


p = factorization(x)
p = make_divisors(x)
# print(p)
Bas = 0
Aas = 0

flg = False
# p.append([1, 1])
# print(p)
for i in range(len(p)):
    if flg:
        break
    _p = p[i]
    # print(_p)
    B = int(-_p/2)

    while True:

        xnew = (B + _p)**5 - B ** 5
        # print(B, xnew)
        if xnew == x:
            Bas = B
            Aas = B + _p
            flg = True
            break

        if xnew > x:
            break

        B += 1


print(f'{Aas} {Bas}')

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


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


p = factorization(x)
# print(p)
Bas = 0
Aas = 0
for i in range(1):
    _p = p[i][0]
    # print(_p)
    B = 0
    while True:

        xnew = (B + _p)**5 - B ** 5
        # print(xnew)
        if xnew == x:
            Bas = B
            Aas = B + _p
            break
        if xnew > x:
            B -= 1
        else:
            B += 1

print(f'{Aas} {Bas}')


Fixed submission:
x = int(input())


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


def make_divisors(n):
    divisors = []
    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


p = factorization(x)
p = make_divisors(x)
# print(p)
Bas = 0
Aas = 0

flg = False
# p.append([1, 1])
# print(p)
for i in range(len(p)):
    if flg:
        break
    _p = p[i]
    # print(_p)
    B = int(-_p/2)

    while True:

        xnew = (B + _p)**5 - B ** 5
        # print(B, xnew)
        if xnew == x:
            Bas = B
            Aas = B + _p
            flg = True
            break

        if xnew > x:
            break

        B += 1


print(f'{Aas} {Bas}')

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


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


p = factorization(x)
# print(p)
Bas = 0
Aas = 0
for i in range(1):
    _p = p[i][0]
    # print(_p)
    B = 0
    while True:

        xnew_p = (B + _p)**5 - B ** 5
        xnew_n = (-1*B + _p)**5 - (-1*B) ** 5
        # print(B, xnew_p, xnew_n)
        if xnew_n == x:
            # print('?')
            Bas = -1*B
            Aas = -B + _p
            break

        if xnew_p == x:
            # print('!')
            Bas = B
            Aas = + _p
            break
        B += 1

print(f'{Aas} {Bas}')


Fixed submission:
x = int(input())


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


def make_divisors(n):
    divisors = []
    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


p = factorization(x)
p = make_divisors(x)
# print(p)
Bas = 0
Aas = 0

flg = False
# p.append([1, 1])
# print(p)
for i in range(len(p)):
    if flg:
        break
    _p = p[i]
    # print(_p)
    B = int(-_p/2)

    while True:

        xnew = (B + _p)**5 - B ** 5
        # print(B, xnew)
        if xnew == x:
            Bas = B
            Aas = B + _p
            flg = True
            break

        if xnew > x:
            break

        B += 1


print(f'{Aas} {Bas}')