Buggy python submission (verdict: Time Limit Exceeded):
S = int(input())
x1, y1, x2, y2, x3, y3 = 0, 0, 0, 0, 0, 0

for i in range(1, int((S * 2) ** 0.5) + 1):
  if S * 2 % i == 0:
    tmp = S * 2 // i
    x2 = tmp // 2
    x3 = tmp - x2
    y3 = i
    if y3 <= 1000000000 and x2 <= 1000000000 and x3 <= 1000000000:
      break
print("{} {} {} {} {} {}".format(x1, y1, x2, y2, x3, y3))

Fixed submission:
S = int(input())
MOD = 10 ** 9
x1, y1, x2, y2 = 0, 0, MOD, 1
y3 = S // MOD
if S % MOD != 0:
  y3 += 1
x3 = x2 * y3 - S

print("{} {} {} {} {} {}".format(x1, y1, x2, y2, x3, y3))

Buggy python submission (verdict: Time Limit Exceeded):
S = int(input())
x1, y1 = 0, 0
y2 = 0
x3 = 0
x2, y3 = 0, 0

for i in range(int(S ** 0.5), S + 1):
  x2 = i
  y3 = S // i
  if S % x2 == 0 and y3 <= 1000000000:
    break
print("{} {} {} {} {} {}".format(x1, y1, x2, y2, x3, y3))

Fixed submission:
S = int(input())
MOD = 10 ** 9
x1, y1, x2, y2 = 0, 0, MOD, 1
y3 = S // MOD
if S % MOD != 0:
  y3 += 1
x3 = x2 * y3 - S

print("{} {} {} {} {} {}".format(x1, y1, x2, y2, x3, y3))

Buggy python submission (verdict: Time Limit Exceeded):
S = int(input())
x1, y1 = 0, 0
y2 = 0
x3 = 0
x2, y3 = 0, 0

for i in range(int(S ** 0.5), S + 1):
  x2 = i
  y3 = S // i
  if S % x2 == 0 and x2 <= 1000000000:
    break
print("{} {} {} {} {} {}".format(x1, y1, x2, y2, x3, y3))


Fixed submission:
S = int(input())
MOD = 10 ** 9
x1, y1, x2, y2 = 0, 0, MOD, 1
y3 = S // MOD
if S % MOD != 0:
  y3 += 1
x3 = x2 * y3 - S

print("{} {} {} {} {} {}".format(x1, y1, x2, y2, x3, y3))

Buggy python submission (verdict: Time Limit Exceeded):
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)
  return divisors

S = int(input())

x1, y2 = 0, 0
y1, x2, x3, y3 = 0, 0, 0, 0

flag = False
div = make_divisors(S)
for d in div:
  x2 = d
  y3 = S // x2
  if x2 <= 1000000000 and y3 <= 1000000000:
    flag = True
    break

if flag == False:
  for i in range(1, int(S ** 0.5) + 1):
    x2 = i
    if S / x2 > 1000000000:
      continue
    Y = S / x2
    y3 = int(Y) + 2
    x3 = x2 // 2
    if x3 == 0:
      y1 = 2
    else:
      y1 = (Y - y3) * x2 / x3
    if y1 == int(y1):
      break

print("{} {} {} {} {} {}".format(x1, y1, x2, y2, x3, y3))

Fixed submission:
S = int(input())
MOD = 10 ** 9
x1, y1, x2, y2 = 0, 0, MOD, 1
y3 = S // MOD
if S % MOD != 0:
  y3 += 1
x3 = x2 * y3 - S

print("{} {} {} {} {} {}".format(x1, y1, x2, y2, x3, y3))

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

x1, y2 = 0, 0
y1, x2, x3, y3 = 0, 0, 0, 0

for i in range(1, int(S ** 0.5) + 1):
  x2 = i
  if S / x2 > 1000000000:
    continue
  Y = S / x2
  y3 = int(Y) + 2
  x3 = x2 // 2
  if x3 == 0:
    y1 = 2
  else:
    y1 = (Y - y3) * x2 / x3
  if y1 == int(y1):
    break

print("{} {} {} {} {} {}".format(x1, y1, x2, y2, x3, y3))

Fixed submission:
S = int(input())
MOD = 10 ** 9
x1, y1, x2, y2 = 0, 0, MOD, 1
y3 = S // MOD
if S % MOD != 0:
  y3 += 1
x3 = x2 * y3 - S

print("{} {} {} {} {} {}".format(x1, y1, x2, y2, x3, y3))

Buggy python submission (verdict: Time Limit Exceeded):
S = int(input())
x1, y1 = 0, 0
y2 = 0
x3 = 0
x2, y3 = 0, 0

for i in range(int(S ** 0.5), S + 1):
  x2 = i
  y3 = S // i
  if S % x2 == 0 and x2 <= 1000000000 and y3 <= 1000000000:
    break
print("{} {} {} {} {} {}".format(x1, y1, x2, y2, x3, y3))

Fixed submission:
S = int(input())
MOD = 10 ** 9
x1, y1, x2, y2 = 0, 0, MOD, 1
y3 = S // MOD
if S % MOD != 0:
  y3 += 1
x3 = x2 * y3 - S

print("{} {} {} {} {} {}".format(x1, y1, x2, y2, x3, y3))