AtCoder Grand Contest 036 - Triangle

Given is an integer S. Find a combination of six integers X_1,Y_1,X_2,Y_2,X_3, and Y_3 that satisfies all of the following conditions:

* 0 \leq X_1,Y_1,X_2,Y_2,X_3,Y_3 \leq 10^9
* The area of the triangle in a two-dimensional plane whose vertices are (X_1,Y_1),(X_2,Y_2), and (X_3,Y_3) is S/2.



We can prove that there always exist six integers that satisfy the conditions under the constraints of this problem.

Constraints

* 1 \leq S \leq 10^{18}
* All values in input are integers.

Input

Input is given from Standard Input in the following format:


S


Output

Print six integers X_1,Y_1,X_2,Y_2,X_3, and Y_3 that satisfy the conditions, in this order, with spaces in between. If multiple solutions exist, any of them will be accepted.

Examples

Input

3


Output

1 0 2 2 0 1


Input

100


Output

0 0 10 0 0 10


Input

311114770564041497


Output

314159265 358979323 846264338 327950288 419716939 937510582

Source: atcoder | Difficulty: UNKNOWN_DIFFICULTY


Solutions:
s = int(input())
x2 = 10 ** 9
y1 = -(-s // x2)
y2 = 1
x1 = x2 * y1 - s
print(0, 0, x1, x2, y1, y2)


S = int(input())
if S == 10 ** 18:
	print(0, 0, 10 ** 9, 0, 10 ** 9, 10 ** 9)
else:
	print(0, 0, 10 ** 9, 1, 10 ** 9 - S % 10 ** 9, S // 10 ** 9 + 1)


S = int(input())
N = int(10 ** 9)
y1 = -S % N
x1 = (S + y1) // N
print(x1, y1, 1, N, 0, 0)


s = int(input())
x = (10 ** 9 - s % 10 ** 9) % 10 ** 9
y = (s + x) // 10 ** 9
print(0, 0, 10 ** 9, 1, x, y)


s = int(input())
v = 10 ** 9
x = v - s % v
if x == v:
	x = 0
y = (s + x) // v
print(0, 0, 10 ** 9, 1, x, y)


s = int(input())
v = 1000000000
x = (v - s % v) % v
y = (s + x) // v
print(0, 0, v, 1, x, y)


s = int(input())
print(10 ** 9, 1 * (s < 10 ** 18), 10 ** 9 - s % 10 ** 9, s // 10 ** 9 + 1 * (s < 10 ** 18), 0, 0)


s = int(input())
M = 10 ** 9
if s % M:
	print(0, 0, -s % M, 0 - -s // M, M, 1)
else:
	print(0, 0, 0, s // M, M, 0)


S = int(input())
m = 10 ** 9
x = (m - S % m) % m
y = (S + x) // m
print('0 0 {} 1 {} {}'.format(m, x, y))


S = int(input())
M = 10 ** 9
x = (S - 1) // M + 1
y = -(S - x * M)
print(0, 0, 1, M, x, y)


S = int(input())
M = 10 ** 9
t = -S % M
x = (S + t) // M
answer = [0, 0, 1, M, x, t]
print(*answer)


s = int(input())
d = 10 ** 9
c = 1
a = s // 10 ** 9 + (1 if s % 10 ** 9 else 0)
b = a * d - s
print(0, 0, a, b, c, d)


import math
S = int(input())
A = math.ceil(math.sqrt(S))
K = A ** 2 - S
print('0 0 {} {} {} {}'.format(A, K, 1, A))


s = int(input())
v = 10 ** 9
y = -s % v
print(0, 0, v, 1, y, (s + y) // v)


S = int(input())
v = int(1000000000.0)
x = (v - S % v) % v
y = (S + x) // v
print(0, 0, v, 1, x, y)


import math
s = int(input())
print(0, 0, 1, 1000000000, (s - 1) // 1000000000 + 1, ((s - 1) // 1000000000 + 1) * 1000000000 - s)


s = int(input())
x3 = (10 ** 9 - s % 10 ** 9) % 10 ** 9
y3 = (s + x3) // 10 ** 9
print(0, 0, 10 ** 9, 1, x3, y3)


k = 10 ** 9
(x, y) = divmod(-int(input()), k)
print(0, 0, 1, k, -x, y)


import math
S = int(input())
r = math.ceil(S ** 0.5)
d = r ** 2 - S
print(r, d, 1, r, 0, 0)


S = int(input())
r = 10 ** 9
print(0, 0, r, 1, -S % r, (S + -S % r) // r)


N = int(input())
a = -(-N // 10 ** 9)
b = a * 10 ** 9 - N
print(0, 0, 10 ** 9, b, 1, a)


N = int(input())
M = 10 ** 9
y = -(-N // M)
x = (M - N % M) % M
print(0, 0, M, 1, x, y)


import math
s = int(input())
a = math.ceil(s / 10 ** 9)
b = 10 ** 9 * a - s
print(0, 0, 10 ** 9, 1, b, a)


S = int(input())
a = 10 ** 9
print(a, (a - S % a) % a, 1, (S + a - 1) // a, 0, 0)


import math
S = int(input())
x = math.ceil(S / 1000000000)
y = 1000000000 * x - S
print(x, y, '0 0 1 1000000000')


S = int(input())
X1 = (S + 10 ** 9 - 1) // 10 ** 9
X2 = X1 * 10 ** 9 - S
print(X1, 1, X2, 10 ** 9, '0 0')


import math
le = 10 ** 9
s = int(input())
y2 = math.ceil(s / le)
y1 = le * y2 - s
print(0, 0, 1000000000, y1, 1, y2)


import math
s = int(input())
b = math.ceil(s ** 0.5) ** 2 - s
c = 1
a = math.ceil(s ** 0.5)
d = a
print(0, 0, a, b, c, d)


s = int(input())
(x1, y1) = (0, 0)
x2 = 10 ** 9
y2 = 1
y3 = -(-s // 10 ** 9)
x3 = abs(x2 * y3 - s)
print(x1, y1, x2, y2, x3, y3)


s = int(input())
v = 10 ** 9
x = (v - s % v) % v
y = (s + x) // v
print('0 0 1000000000 1 {} {}'.format(x, y))


from math import ceil, sqrt
s = int(input())
a = ceil(sqrt(s))
print(0, 0, a, 1, a ** 2 - s, a)


S = int(input())
X_2 = pow(10, 9)
X_3 = (X_2 - S) % X_2
Y_3 = (S + X_3) // X_2
print(0, 0, X_2, 1, X_3, Y_3)


S = int(input())
M = 10 ** 9
p = [0, 0, 1, M]
(a, b) = divmod(S - 1, M)
print(a + 1, M - b - 1, *p)


S = int(input())
M = 10 ** 9
X1 = 0
Y1 = 0
X2 = M
Y2 = 1
X3 = (M - S % M) % M
Y3 = (S + X3) // M
print(X1, Y1, X2, Y2, X3, Y3)


S = int(input())
s = (S - 1) // 10 ** 9 + 1
S = s * 10 ** 9 - S
print(0, 0, 10 ** 9, S, 1, s)


s = int(input())
t = (s + 10 ** 9 - 1) // 10 ** 9
print(*[0, 0, 10 ** 9, 10 ** 9 * t - s, 1, t])


import sys
input = sys.stdin.readline
S = int(input())
print(0, 0, 10 ** 9, 1, -S % 10 ** 9, -(-S // 10 ** 9))


n = int(input())
mod = 10 ** 9
print(0, 0, mod, 1, (mod - n % mod) % mod, (n + (mod - n % mod) % mod) // mod)


S = int(input())
a = 10 ** 9
d = -(-S // 10 ** 9)
b = 1
c = a * d - S
print(0, 0, a, b, c, d)


s = int(input())
p = 10 ** 9
print(0, 0, p, 1, -s % p, -(-s // p))


S = int(input())
x1 = 1
y1 = 10 ** 9
x2 = (S + 10 ** 9 - 1) // 10 ** 9
y2 = 10 ** 9 * x2 - S
print(0, 0, x1, y1, x2, y2)


S = int(input())
n = 10 ** 9
Y = (n - S % n) % n
X = (S + Y) // n
print('0 0 1 {} {} {}'.format(n, X, Y))


s = int(input())
thld = pow(10, 9)
x = (thld - s % thld) % thld
print(0, 0, thld, 1, x, (s + x) // thld)


S = int(input())
LIM = 1000000000
x3 = (S + LIM - 1) // LIM
y3 = x3 * LIM - S
print(0, 0, 1, LIM, x3, y3)


(n, t) = (int(input()), 10 ** 9)
print('0 0 1 ' + str(t) + ' ' + str((n - 1) // t + 1) + ' ' + str(t - 1 - (n - 1) % t))


S = int(input())
x = 10 ** 9
y = -(-S // x)
z = x * y - S
print(0, 0, x, 1, z, y)


s = int(input())
i = 10 ** 9
a = (i - s % i) % i
b = (s + a) // i
print(0, 0, 10 ** 9, 1, a, b)


import math
s = int(input())
e = 1000000000
x = (e - s % e) % e
print(0, 0, e, 1, x, (s + x) // e)


S = int(input())
v = 10 ** 9
a = (v - S % v) % v
b = (S + a) // v
print(0, 0, 10 ** 9, 1, a, b)


S = int(input())
M = 10 ** 9
print(*[0, 0, 1, M, 0 - -S // M, -S % M])


import math
S = int(input())
v = 10 ** 9
x3 = (v - S % v) % v
y3 = (S + x3) // v
print('0 0 %d 1 %d %d' % (10 ** 9, x3, y3))


s = int(input())
A = 10 ** 9
v = (s + A - 1) // A
w = A * v - s
print(0, 0, A, w, 1, v)


from math import ceil
S = int(input())
y = ceil(S / 10 ** 9)
x = 10 ** 9 * y - S
print(0, 0, 10 ** 9, 1, x, y)


import math
S = int(input())
x1 = 10 ** 9
y2 = math.ceil(S / x1)
x2 = 1
y1 = x1 * y2 - S
(x3, y3) = (0, 0)
print(x1, y1, x2, y2, x3, y3)


s = int(input())
k = -(-s // 10 ** 9)
a = 10 ** 9 * k - s
print(0, 0, 1, k, 10 ** 9, a)


s = int(input())
n = 10 ** 9
x = 0 - -s // n
y = -s % n
print('0 0 {} {} {} {}'.format(y, x, n, 1))


S = int(input())
G = 10 ** 9
Q = S // G
R = S % G
if R > 0:
	Q += 1
	R -= G
print(0, 0, G, 1, -R, Q)


s = int(input())
d = (s - 1) // 10 ** 9 + 1
c = 10 ** 9 * d - s
print(0, 0, 10 ** 9, 1, c, d)


S = int(input())
v = 10 ** 9
x = (v - S % v) % v
y = (S + x) // v
print(0, 0, 10 ** 9, 1, x, y)


s = int(input())
if s == 10 ** 18:
	print(0, 0, 10 ** 9, 0, 0, 10 ** 9)
	exit()
print(0, 0, 10 ** 9, 1, 10 ** 9 - s % 10 ** 9, s // 10 ** 9 + 1)


S = int(input())
a = S // 10 ** 9
if S % 10 ** 9 != 0:
	a += 1
b = 10 ** 9 * a - S
print(0, 0, 10 ** 9, 1, b, a)


s = int(input())
y2 = -(-s // 10 ** 9)
y1 = 10 ** 9 * y2 - s
print(0, 0, 10 ** 9, y1, 1, y2)


S = int(input())
X2 = 10 ** 9
Y2 = 1
X3 = (X2 - S % X2) % 10 ** 9
Y3 = (S + X3) // X2
print(0, 0, X2, Y2, X3, Y3)


N = -int(input())
M = 10 ** 9
print(0, 0, 1, M, 0 - N // M, N % M)


from math import sqrt
S = int(input())
A = int(sqrt(S))
while S - A * A > 0:
	A += 1
print(0, 0, A, A * A - S, 1, A)


(s, v) = (int(input()), 1000000000)
print(0, 0, v, 1, -s % v, (s + -s % v) // v)


m = 10 ** 9
s = int(input())
if s % m:
	y = s // m + 1
	x = m - s % m
else:
	y = s // m
	x = 0
Ans = [0, 0, 10 ** 9, 1, x, y]
print(*Ans)


S = int(input())
A = 10 ** 9
B = 1
D = (S + -S % A) // A
C = (A * D - S) // B
print(0, 0, A, B, C, D)


import math
s = int(input())
x = (10 ** 9 - s % 10 ** 9) % 10 ** 9
y = (s + x) // 10 ** 9
print(0, 0, 10 ** 9, 1, x, y)


S = int(input())
x2 = 10 ** 9
x3 = (x2 - S % x2) % x2
y3 = (S + x3) // x2
print('0 0 {} 1 {} {}'.format(x2, x3, y3))


import math
s = int(input())
sq = math.ceil(math.sqrt(s))
print(0, 0, sq, 1, sq ** 2 - s, sq)


S = int(input())
N = int(1000000000.0)
x = N - (S - 1) % N - 1
y = (S - 1) // N + 1
print(0, 0, N, 1, x, y)


import math
s = int(input())
lim = 10 ** 9
n = math.ceil(s ** 0.5)
print(0, 0, n, 1, n ** 2 - s, n)


S = int(input())
mod = 1000000000
x3 = (S - 1) // mod + 1
y3 = mod - ((S - 1) % mod + 1)
print(0, 0, 1, mod, x3, y3)


S = int(input())
m = 10 ** 9
print(0, 0, 1, m, (S + m - 1) // m, (m - S % m) % m)


S = int(input())
x3 = 10 ** 9 - S % 10 ** 9
x3 = 0 if x3 == 10 ** 9 else x3
y3 = (S + x3) // 10 ** 9
print(0, 0, 10 ** 9, 1, x3, y3)


S = int(input())
N = 10 ** 9
x = (N - S % N) % N
y = -(-S // N)
print(0, 0, 10 ** 9, 1, x, y)


s = int(input())
l = [0, 0, 10 ** 9, 1, 10 ** 9 - s % 10 ** 9, s // 10 ** 9 + 1]
if s == 10 ** 18:
	l = [0, 0, 10 ** 9, 0, 0, 10 ** 9]
print(*l)


s = int(input())
M = 10 ** 9
print(0, 0, M, 1, -s % M, -(-s // M))


S = int(input())
A = 10 ** 9
C = S // A
B = S % A
if B != 0:
	C += 1
	B = A - B
ANS = [0, 0, A, 1, B, C]
print(*ANS)


L = 10 ** 9
N = int(input())
y = (N - 1) // L + 1
x = -N % L
print(0, 0, L, 1, x, y)


s = int(input())
if s == 10 ** 18:
	print(0, 0, 10 ** 9, 0, 0, 10 ** 9)
else:
	print(0, 0, s // 10 ** 9 + 1, 1, 10 ** 9 - s % 10 ** 9, 10 ** 9)


S = int(input())
X = (S + 10 ** 9 - 1) // 10 ** 9
print(0, 0, X, 1, X * 10 ** 9 - S, 10 ** 9)


import math
s = int(input())
x1 = 10 ** 9
y2 = math.ceil(s / 10 ** 9)
x2 = 1
y1 = x1 * y2 - s
print(0, 0, x1, y1, x2, y2)


import math
n = int(input())
m = math.ceil(n ** 0.5)
k = m ** 2 - n
print(m, k, 1, m, 0, 0)


s = int(input())
t = 10 ** 9
if s % t == 0:
	print(0, 0, 1, t, s // t, 0)
else:
	print(0, 0, 1, t, s // t + 1, t - s % t)


dekai = 10 ** 9
s = int(input())
ans = [0, 0, dekai, 1, 0, s // dekai]
if s % dekai:
	ans[5] += 1
ans[4] = dekai * ans[5] - s
print(*ans)


a = int(input())
ax = ay = 0
bx = 1
by = 10 ** 9
cx = (a + by - 1) // by
cy = cx * by - a
print(ax, ay, bx, by, cx, cy)


import math
s = int(input())
x1 = 1000000000
y1 = 1
y2 = math.ceil(s / x1)
x2 = y2 * x1 - s
print(0, 0, x1, y1, x2, y2)


s = int(input())
a = 0
b = 0
c = 1
d = 10 ** 9
e = (s - 1) // d + 1
f = e * d - s
print(a, b, c, d, e, f)


S = int(input())
M = 10 ** 9
(Q, R) = divmod(S, M)
if R:
	print(0, 0, M, 1, M - R, Q + 1)
else:
	print(0, 0, M, 1, 0, Q)


import math
S = int(input())
(X1, Y1) = (0, 0)
X2 = math.ceil(math.sqrt(S))
Y3 = X2
Y2 = 1
X3 = X2 * Y3 - S
print(X1, Y1, X2, Y2, X3, Y3)


n = int(input())
x0 = 0
y0 = 0
x1 = 1
y1 = 10 ** 9
x2 = (n - 1) // y1 + 1
y2 = (y1 - n) % y1
print(x0, y0, x1, y1, x2, y2)


import math
s = int(input())
sq = math.ceil(math.sqrt(s))
l = map(str, [sq, 1, sq ** 2 - s, sq, 0, 0])
print(' '.join(l))


S = int(input())
MOD = 10 ** 9
y2 = -(-S // 10 ** 9)
x2 = -(S - y2 * 10 ** 9)
print('0 0 {} 1 {} {}'.format(MOD, x2, y2))


S = int(input())
x = 10 ** 9
b = S // x
if S % x != 0:
	b += 1
c = x * b - S
print(0, 0, 10 ** 9, c, 1, b)


s = int(input())
d = s // 10 ** 9 + 1
c = 10 ** 9 * d - s
if s == 10 ** 18:
	(c, d) = (0, 10 ** 9)
print(0, 0, 10 ** 9, 1, c, d)


S = int(input())
t = 10 ** 9
print(0, 0, 1, t, S // t + (S % t != 0), (t - S % t) % t)


import math
S = int(input())
s = math.ceil(S ** 0.5)
A = s
C2 = A
C1 = A - 1
B = s ** 2 - S
print(A, 0, 0, B, C1, C2, sep=' ')


n = int(input())
a = -(-n // 10 ** 9)
b = 10 ** 9 * a - n
print(0, 0, 10 ** 9, 1, b, a)


n = int(input())
m = 10 ** 9
y = -(-n // m)
x = (m - n % m) % m
print(0, 0, m, 1, x, y)


s = int(input())
l = 10 ** 9
n = 0 - -s // l
print(0, 0, 1, l, n, n * l - s)


s = int(input())
mx = int(1000000000.0)
x = (mx - s % mx) % mx
y = (s + x) // mx
print(0, 0, mx, 1, x, y)


import math

def main():
	S = int(input())
	r = math.ceil(math.sqrt(S))
	print(0, 0, r, 1, r * r - S, r)
main()


import math
s = int(input())
rs = math.ceil(math.sqrt(s))
d = rs ** 2 - s
print(0, 0, rs, d, 1, rs)


import math
s = int(input())
l = 10 ** 9
q = math.ceil(s / l)
r = l * q - s
print(0, 0, 1, l, q, r)


N = int(input())
x = N % 10 ** 9
y = N // 10 ** 9
if x > 0:
	x -= 10 ** 9
	y += 1
print(0, 0, 10 ** 9, 1, -x, y)


s = int(input())
x1 = 10 ** 9
y2 = s // x1
if s % x1 != 0:
	y2 += 1
y1 = y2 * x1 - s
print(0, 0, x1, y1, 1, y2)


s = int(input())
x1 = 0
y1 = 0
x2 = int(1000000000.0)
y2 = 1
x3 = (x2 - s % x2) % x2
y3 = int((s + x3) / x2)
print(x1, y1, x2, y2, x3, y3)


import math
S = int(input())
ss = math.ceil(math.sqrt(S))
print('{} {} {} {} {} {}'.format(ss, ss ** 2 - S, 1, ss, 0, 0))


S = int(input())
v = 10 ** 9
b2 = (S + v - 1) // v
b1 = v * b2 - S
print(v, 1, 0, 0, b1, b2)


import math
s = int(input())
e = math.ceil(s ** 0.5)
print(0, 0, e, 1, e ** 2 - s, e)


from math import ceil
S = int(input())
Y = int(ceil(S / 10 ** 9))
X = Y * 10 ** 9 - S
print(0, 0, 10 ** 9, 1, X, Y)


s = int(input())
a = 10 ** 9
c = (a - s % a) % a
b = (s + c) // a
print(0, 0, a, 1, c, b)


import math
s = int(input())
a = math.ceil(math.sqrt(s))
b = a * a - s
print(0, 0, a, 1, b, a)


m = 10 ** 9
s = int(input())
print(0, 0, 1, m, (s - 1) // m + 1, (m - s) % m)


s = int(input())
n = 1000000000
x = (n - s % n) % n
y = (s + x) // n
print(*[1, n, y, x, 0, 0])


s = int(input())
v = 10 ** 9
x = -s % v
print(0, 0, v, 1, x, (s + x) // v)


S = int(input())
d = (S - 1) // 10 ** 9 + 1
c = 10 ** 9 * d - S
print(0, 0, 10 ** 9, 1, c, d)


S = int(input())
L = 10 ** 9
if S == L ** 2:
	print(0, 0, L, 0, 0, L)
else:
	(A, B) = (S // L, S % L)
	print(0, 0, L, 1, L - B, A + 1)


S = int(input())
MAX_V = 10 ** 9
X3 = -S % MAX_V
Y3 = (S + X3) // MAX_V
print(0, 0, MAX_V, 1, X3, Y3)


S = int(input())
X1 = (S + 999999999) // 1000000000
X2 = X1 * 1000000000 - S
print(X1, 1, X2, '1000000000 0 0')