Buggy python submission (verdict: Time Limit Exceeded):
def solve(s):
    k = 10 ** 9
    if s <= k:
        return 0, 0, 1, 0, 0, s
    X = k
    while True:
        Y = (s - 1) // X + 1
        while Y <= k:
            xy = X * Y - s
            lim = min(Y, int(xy ** 0.5))
            for y in range(1, lim + 1):
                x, m = divmod(xy, y)
                if x <= X and m == 0:
                    return 0, 0, X, y, x, Y
            Y += 1
        X -= 1


s = int(input())
print(*solve(s))


Fixed submission:
def solve(s):
    k = 10 ** 9
    if s <= k:
        return 0, 0, 1, 0, 0, s
    X = k
    while True:
        Y = (s - 1) // X + 1
        while Y <= k:
            xy = X * Y - s
            if xy == 0:
                return 0, 0, X, 0, 0, Y
            lim = min(Y, int(xy ** 0.5))
            for y in range(1, lim + 1):
                x, m = divmod(xy, y)
                if x <= X and m == 0:
                    return 0, 0, X, y, x, Y
            Y += 1
        X -= 1


s = int(input())
print(*solve(s))

Buggy python submission (verdict: Runtime Error):
def solve(s):
    k = 10 ** 9
    if s <= k:
        return 0, 0, 1, 0, 0, s
    X = k
    Y = (s - 1) // X + 1
    while Y <= k:
        xy = X * Y - s
        lim = min(Y, int(xy ** 0.5))
        for y in range(1, lim + 1):
            x, m = divmod(xy, y)
            if x <= X and m == 0:
                return 0, 0, X, y, x, Y
        Y += 1


s = int(input())
print(*solve(s))


Fixed submission:
def solve(s):
    k = 10 ** 9
    if s <= k:
        return 0, 0, 1, 0, 0, s
    X = k
    while True:
        Y = (s - 1) // X + 1
        while Y <= k:
            xy = X * Y - s
            if xy == 0:
                return 0, 0, X, 0, 0, Y
            lim = min(Y, int(xy ** 0.5))
            for y in range(1, lim + 1):
                x, m = divmod(xy, y)
                if x <= X and m == 0:
                    return 0, 0, X, y, x, Y
            Y += 1
        X -= 1


s = int(input())
print(*solve(s))

Buggy python submission (verdict: Runtime Error):
def solve(s):
    if s <= 10 ** 9:
        return 0, 0, 1, 0, 0, s
    X = 10 ** 9
    Y = (s - 1) // X + 1
    xy = X * Y - s
    lim = min(Y, int(xy ** 0.5))
    for y in range(1, lim + 1):
        x, m = divmod(xy, y)
        if x <= X and m == 0:
            return 0, 0, X, y, x, Y


s = int(input())
print(*solve(s))


Fixed submission:
def solve(s):
    k = 10 ** 9
    if s <= k:
        return 0, 0, 1, 0, 0, s
    X = k
    while True:
        Y = (s - 1) // X + 1
        while Y <= k:
            xy = X * Y - s
            if xy == 0:
                return 0, 0, X, 0, 0, Y
            lim = min(Y, int(xy ** 0.5))
            for y in range(1, lim + 1):
                x, m = divmod(xy, y)
                if x <= X and m == 0:
                    return 0, 0, X, y, x, Y
            Y += 1
        X -= 1


s = int(input())
print(*solve(s))

Buggy python submission (verdict: Runtime Error):
def solve(s):
    if s <= 10 ** 9:
        return 0, 0, 0, 1, 0, s
    X = 10 ** 9
    Y = (s - 1) // X + 1
    xy = X * Y - s
    lim = min(Y, int(xy ** 0.5))
    for y in range(1, lim + 1):
        x, m = divmod(xy, y)
        if x <= X and m == 0:
            return 0, 0, X, y, x, Y


s = int(input())
print(*solve(s))


Fixed submission:
def solve(s):
    k = 10 ** 9
    if s <= k:
        return 0, 0, 1, 0, 0, s
    X = k
    while True:
        Y = (s - 1) // X + 1
        while Y <= k:
            xy = X * Y - s
            if xy == 0:
                return 0, 0, X, 0, 0, Y
            lim = min(Y, int(xy ** 0.5))
            for y in range(1, lim + 1):
                x, m = divmod(xy, y)
                if x <= X and m == 0:
                    return 0, 0, X, y, x, Y
            Y += 1
        X -= 1


s = int(input())
print(*solve(s))