Buggy python submission (verdict: Runtime Error):
import math
import sympy
S = int(input())
x = int(math.ceil(math.sqrt(S)))
Z = x * x - S

if Z == 0:
    z = 0
    oz = 0
else:
    fs = sympy.factorint(Z)
    z = 1
    oz = 1
    for k in fs:
        c = fs[k]
        while c >= 2:
            z *= k
            oz *= k
            c -= 2
        if c > 0:
            if z < oz:
                z *= k
            else:
                oz *= k




print("0 0 {} {} {} {}".format(x, z, oz, x))

Fixed submission:
import math
def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct

S = int(input())
x = int(math.ceil(math.sqrt(S)))
Z = x * x - S

if Z == 0:
    z = 0
    oz = 0
else:
    fs = factorize(Z)
    z = 1
    oz = 1
    for k, c in fs:
        while c >= 2:
            z *= k
            oz *= k
            c -= 2
        if c > 0:
            if z < oz:
                z *= k
            else:
                oz *= k




print("0 0 {} {} {} {}".format(x, z, oz, x))

Buggy python submission (verdict: Runtime Error):
import math
import sympy
S = int(input())
x = int(math.ceil(math.sqrt(S)))
Z = x * x - S

if Z == 0:
    z = 0
    oz = 0
else:
    fs = sympy.factorint(Z)
    z = 1
    oz = 1
    for k in fs:
        c = fs[k]
        while c >= 2:
            z *= k
            oz *= k
            c -= 2
        if c > 0:
            if z < oz:
                z *= k
            else:
                oz *= k




print("0 0 {} {} {} {}".format(x, z, oz, x))


Fixed submission:
import math
def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct

S = int(input())
x = int(math.ceil(math.sqrt(S)))
Z = x * x - S

if Z == 0:
    z = 0
    oz = 0
else:
    fs = factorize(Z)
    z = 1
    oz = 1
    for k, c in fs:
        while c >= 2:
            z *= k
            oz *= k
            c -= 2
        if c > 0:
            if z < oz:
                z *= k
            else:
                oz *= k




print("0 0 {} {} {} {}".format(x, z, oz, x))

Buggy python submission (verdict: Time Limit Exceeded):
import math
S = int(input())
x = int(math.ceil(math.sqrt(S)))
Z = x * x - S
z = int(math.ceil(math.sqrt(Z)))

if z == 0:
    oz = 0
else:
    while True:
        oz = Z // z
        if Z % z == 0:
            break
        z += 1

print("0 0 {} {} {} {}".format(x, z, oz, x))

Fixed submission:
import math
def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct

S = int(input())
x = int(math.ceil(math.sqrt(S)))
Z = x * x - S

if Z == 0:
    z = 0
    oz = 0
else:
    fs = factorize(Z)
    z = 1
    oz = 1
    for k, c in fs:
        while c >= 2:
            z *= k
            oz *= k
            c -= 2
        if c > 0:
            if z < oz:
                z *= k
            else:
                oz *= k




print("0 0 {} {} {} {}".format(x, z, oz, x))

Buggy python submission (verdict: Time Limit Exceeded):
import math
S = int(input())
x = int(math.ceil(math.sqrt(S)))
Z = x * x - S
z = int(math.ceil(math.sqrt(Z)))

if z == 0:
    oz = 0
else:
    while True:
        oz = Z // z
        if Z % z == 0:
            break
        z += 1

print("0 0 {} {} {} {}".format(x, z, oz, x))


Fixed submission:
import math
def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct

S = int(input())
x = int(math.ceil(math.sqrt(S)))
Z = x * x - S

if Z == 0:
    z = 0
    oz = 0
else:
    fs = factorize(Z)
    z = 1
    oz = 1
    for k, c in fs:
        while c >= 2:
            z *= k
            oz *= k
            c -= 2
        if c > 0:
            if z < oz:
                z *= k
            else:
                oz *= k




print("0 0 {} {} {} {}".format(x, z, oz, x))