Problem:
 Score : 400 points    Problem Statement 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.        Sample Input 1 3      Sample Output 1 1 0 2 2 0 1  The area of the triangle in a two-dimensional plane whose vertices are (1,0),(2,2), and (0,1) is 3/2 .
Printing 3 0 3 1 0 1 or 1 0 0 1 2 2 will also be accepted.       Sample Input 2 100      Sample Output 2 0 0 10 0 0 10       Sample Input 3 311114770564041497      Sample Output 3 314159265 358979323 846264338 327950288 419716939 937510582

Solution (Python):
s = int(input())

x2 = 10**9
y2 = 1
x3 = s % (10**9) 
y3 = s // (10**9) 
if x3 > 0:
  x3 = 10**9 - s % (10**9) 
  y3 = s // (10**9) + 1
print("0 0 " + str(10**9) + " 1 " + str(x3) + " " + str(y3))

Solution (Python):

S = int(input())
a, b = divmod(S, 10**9)
if b > 0:
    b = 10**9-b
    a += 1
print(0, 0, 10**9, 1, b, a)

Solution (Python):
s = int(input())

if s % 10**9 == 0:
    y2 = s // 10**9
else:
    y2 = s // 10**9 + 1
    
y1 = 10**9*y2 - s

print(0,0,10**9,y1,1,y2)

Solution (Python):
import sys



def input():
    return sys.stdin.readline().strip()


def input_int():
    return int(input())


def input_int_list():
    return [int(i) for i in input().split()]


def main():
    S = input_int()
    x0 = y0 = 0
    x1 = 1
    x2 = 10**9
    y2 = -S % 10**9
    y1 = (S + y2) // 10**9

    print(x0, y0, x1, y1, x2, y2)
    return


if __name__ == "__main__":
    main()

Solution (Python):
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)

Solution (Python):
def f():
    s = int(input())
    i9 = 10**9
    if s == i9 ** 2:
        print(i9, 0, 0, i9, 0, 0)
    else:
        print(i9 - (s%i9), s//i9 + 1, i9, 1, 0, 0)

if __name__ == '__main__':
    f()

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

Solution (Python):
import numpy as np
s=int(input())

x2=int(np.ceil(np.sqrt(s)))
y3=x2

res=x2*y3-s

print('0 0 {} 1 {} {}'.format(x2,res,y3))

Solution (Python):

def resolve():
    S = int(input())

    x1, y1 = 0, 0
    x2, y2 = 1, 10 ** 9

    x3 = (S + y2 - 1) // y2
    y3 = x3 * y2 - S

    print(x1, y1, x2, y2, x3, y3)


if __name__ == "__main__":
    resolve()

Solution (Python):
S = int(input())
m = S // (10**9)
n = S % (10**9)

p,q = 0,0
r,s = 0,0
if(m == 10**9):
    p,q = 10**9,1
    r,s = 0,10**9
else:
    p,q = m+1,10**9-n
    r,s = 1,10**9
print(0,0,p,q,r,s)

Solution (Python):
import sys
from sys import exit
from collections import deque
from bisect import bisect_left, bisect_right, insort_left, insort_right
from heapq import heapify, heappop, heappush
from itertools import product, permutations, combinations, combinations_with_replacement
from functools import reduce
from math import gcd, sin, cos, tan, asin, acos, atan, degrees, radians

sys.setrecursionlimit(10**6)
INF = 10**20
eps = 1.0e-20
MOD = 10**9+7

def lcm(x,y):
    return x*y//gcd(x,y)
def lgcd(l):
    return reduce(gcd,l)
def llcm(l):
    return reduce(lcm,l)
def powmod(n,i,mod):
    return pow(n,mod-1+i,mod) if i<0 else pow(n,i,mod)
def div2(x):
    return x.bit_length()
def div10(x):
    return len(str(x))-(x==0)
def intput():
    return int(input())
def mint():
    return map(int,input().split())
def lint():
    return list(map(int,input().split()))
def ilint():
    return int(input()), list(map(int,input().split()))
def judge(x, l=['Yes', 'No']):
    print(l[0] if x else l[1])
def lprint(l, sep='\n'):
    for x in l:
        print(x, end=sep)
def ston(c, c0='a'):
    return ord(c)-ord(c0)
def ntos(x, c0='a'):
    return chr(x+ord(c0))
class counter(dict):
    def __init__(self, *args):
        super().__init__(args)
    def add(self,x,d=1):
        self.setdefault(x,0)
        self[x] += d
    def list(self):
        l = []
        for k in self:
            l.extend([k]*self[k])
        return l
class comb():
    def __init__(self, n, mod=None):
        self.l = [1]
        self.n = n
        self.mod = mod
    def get(self,k):
        l,n,mod = self.l, self.n, self.mod
        k = n-k if k>n//2 else k
        while len(l)<=k:
            i = len(l)
            l.append(l[i-1]*(n+1-i)//i if mod==None else (l[i-1]*(n+1-i)*powmod(i,-1,mod))%mod)
        return l[k]
def pf(x):
    C = counter()
    p = 2
    while x>1:
        k = 0
        while x%p==0:
            x //= p
            k += 1
        if k>0:
            C.add(p,k)
        p = p+2-(p==2) if p*p<x else x
    return C

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

Solution (Python):
import math
S = int(input())

a = int(math.sqrt(S))
if S - a**2 > 0:
  a += 1
b = a**2 - S
c = 1
if b >= 10**8:
  s = int(math.sqrt(b))
  for i in range(s):
    if b % (s-i) == 0:
      b //= (s-i)
      c *= (s-i)
      break
print(0, 0, a, b, c, a)

Solution (Python):
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")
al = "abcdefghijklmnopqrstuvwxyz"
AL = al.upper()

s = k()
q = s//(mod-7)
r = s%(mod-7)

if s == 10**18:
    print(0,0,10**9,0,0,10**9)
else:
    print(0,0,10**9,1,10**9-r,q+1)

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

Solution (Python):
s = int(input())

y1 = int(1e9)
x2 = s//y1 + (0 if s == int(1e18) else 1)

x1 = 1
y2 = x2*y1-s

ans = [0, 0, x1, y1, x2, y2]

print(" ".join(map(str, ans)))

Solution (Python):
n,t=int(input()),10**9
print("0 0 1 "+str(t)+" "+str((n-1)//t+1)+" "+str(t-1-(n-1)%t))

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

Solution (Python):

s = int(input())

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

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

Solution (Python):

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

Solution (Python):
S=int(input())
MOD=10**9
if S%MOD==0:
    s=0
else:
    s=MOD-S%MOD

X1,Y2=s,1
Y1=10**9
X2=(S+X1)//Y1

print(0,0,X1,Y1,X2,Y2)

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

Solution (Python):
s = int(input())








don = 10 ** 9

y = (don - s % don) % don
x = (s + y) // don
print('0 0 {} 1 {} {}'.format(don, y, x))

Solution (Python):
S = int(input())
LIM = 1_000_000_000
x3 = (S + LIM - 1) // LIM
y3 = x3 * LIM - S
print(0, 0, 1, LIM, x3, y3)

Solution (Python):
import math
s=int(input())
thre = math.ceil(s**0.5)
left = thre**2
rem = left - s
for i in range(1,10**7):
    if rem%i == 0:
        a,b = i,rem//i
        break
print(0,0,thre,b,a,thre)

Solution (Python):
S = int(input())

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

Solution (Python):
s = int(input())
a = (s-1)//10**9+1; b = 10**9-(s-1)%10**9-1
print(0, 0, 1, a, 10**9, b)

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

Solution (Python):
import math

s=int(input())

n=math.ceil(math.sqrt(s))

if n*n-s<0:
  n+=1

x2=n
y3=n

while x2*y3-s>10**9:
  y3-=1

y2=x2*y3-s
x3=1

print(0,0,x2,y2,x3,y3)

Solution (Python):

import sys

sysread = sys.stdin.buffer.readline
read = sys.stdin.buffer.read


sys.setrecursionlimit(10**7)
import math








INF = 1 << 50

def run():
    S = int(input())
    x1 = 10 ** 9
    y1 = 1
    if not S % x1:
        x2 = 0
        y2 = S // x1
    else:
        x2 = x1 - (S % x1)
        y2 = S // x1 + 1
    print(0,0,x1,y1,x2,y2)
    

if __name__ == "__main__":
    run()

Solution (Python):
S = int(input())

v = 10**9
a = (v-S%v)%v
b = (S+a)//v

print(0, 0, 10**9, 1, a, b)

Solution (Python):
from math import*
def fact_p(n):
  m=n
  i=2
  a=0
  while n>1:
    if i>m**.5:
      a=n
      break
    while n%i==0:
      n//=i
      a=i
    i+=1  
  return a
n=int(input())
x2=y1=ceil(n**.5+.5) if ceil(n**.5+.5)<=10**9 else 10**9
x1=fact_p(x2*y1-n)
y2=(x2*y1-n)//x1 if x1 else 0
print(0,0,x1,y1,x2,y2)

Solution (Python):






S = int(input())





x1 = 0; y1 = 0
if S <= 10**9:
    x2 = S; y2 = 0
    x3 = 0; y3 = 1
else:
    x2 = 10**9; y2 = 1
    mod = 10**9
    x3 = (mod - S%mod)%mod
    y3 = (S+x3)//mod
print(x1,y1,x2,y2,x3,y3)

Solution (Python):
s = int(input())

div, mod = divmod(s, 10 ** 9)
ans = [0, 0, 10 ** 9, 1, 0, div]
if mod != 0:
    ans[4:] = [10 ** 9 - mod, div + 1]
print(*ans)

Solution (Python):
s = int(input())

div, mod = divmod(s, 10 ** 9)
ans = [0, 0, 10 ** 9, 1]
ans += [(10 ** 9 - mod) * (mod != 0), div + (mod != 0)]
print(*ans)

Solution (Python):
s = int(input())

ans, num = [0, 0, 10 ** 9, 1], 10 ** 9
if s % num == 0:
    ans += [0, s // num]
elif s % num != 0:
    ans += [num - s % num, s // num + 1]
print(*ans)

Solution (Python):
s = int(input())

ans, num = [0, 0, 10 ** 9, 1], 10 ** 9
cnt = s % num
if cnt == 0:
    ans += [0, s // num]
elif cnt != 0:
    ans += [num - cnt, s // num + 1]
print(*ans)

Solution (Python):
s = int(input())

ans, num = [0, 0, 10 ** 9, 1], 10 ** 9
if s % num == 0:
    ans += [0, s // num]
elif s % num != 0:
    ans += [num - s % num, s // num + 1]
print(*ans)

Solution (Python):
s = int(input())

ans, num = [0, 0, 10 ** 9, 1], 10 ** 9
if s % num == 0:
    ans += [0, s // num]
elif s % num != 0:
    ans += [abs(s % num - num), s // num + 1]
print(*ans)

Solution (Python):
S = int(input())

if S <= 10**9:
    ans = [0, 0, S, 0, 0, 1]
    print(*ans)
    exit()
else:
    if S == 10 ** 18:
        ans = [0, 0, 10 ** 9, 0, 0, 10 ** 9]
        print(*ans)
        exit()
    mod = S % (10 ** 9)
    syou = S // (10 ** 9)
    x3 = 10 ** 9 - mod
    y3 = syou + 1
    ans = [0, 0, 10 ** 9, 1, x3, y3]
    print(*ans)

Solution (Python):
s=int(input())
x1=0
y1=0
x3=1
x2=10**9
if s==10**18:
  y3=10**9
  y2=0
else:
  y3=s//(10**9)+1
  y2=10**9-s%(10**9)
a=[x1,y1,x2,y2,x3,y3]
a=map(str,a)
print((' ').join(a))

Solution (Python):
s=int(input())
if s+1<=10**9:
  b=str(s+1)
  a=['0','0',b,'1','1','1']
else:
  a=int(s**(1/2))
  if a**2>=s:
    a_=a
  else:
    if a*(a+1)>=s:
      a_=a+1
    else:
      if a*(a+2)>=s and a+2<=10**9:
        a_=a+2
      else:
        a_=a+1
        a+=1
  x2=str(a)
  y3=str(a_)
  
  y2=str(1)
  x3=str(int(x2)*int(y3)-s)
  x1=str(0)
  y1=str(0)
  a=[x1,y1,x2,y2,x3,y3]
print((' ').join(a))

Solution (Python):
s=int(input())
if s+1<=10**9:
  b=str(s+1)
  a=['0','0',b,'1','1','1']
else:
  x2=int(s**(1/2))
  y3=int(s**(1/2))
  while x2*y3<s:
    y3+=1
  if y3>10**9:
    x2+=1
    y3=int(s**(1/2))+1
  x2=str(x2)
  y3=str(y3)
  
  y2=str(1)
  x3=str(int(x2)*int(y3)-s)
  x1=str(0)
  y1=str(0)
  a=[x1,y1,x2,y2,x3,y3]
print((' ').join(a))

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

Solution (Python):
s=int(input())

v=10**9

x=(v-s%v)%v

y=(s+x)//v

print('0 0 1000000000 1 {} {}'.format(x,y))

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

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

Solution (Python):
def main():
    s = int(input())
    x1, y1 = 0, 0
    x2, y2 = 1, int(1e9)
    x3, y3 = 0, 0

    l, r = 1, int(1e9)
    while True:
        m = int((l + r) / 2)
        y = m * int(1e9) - s
        if y < 0:
            l = m + 1
        elif y > 1e9:
            r = m - 1
        else:
            x3, y3 = m, y
            break
    if s == int(1e18):
        x2, y2 = 0, int(1e9)
        x3, y3 = int(1e9), 0
    print(x1, y1, x2, y2, x3, y3)


main()

Solution (Python):
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    S = I()

    
    
    y = (S - 1) // 10 ** 9 + 1
    x = 10 ** 9 * y - S

    print(0, 0, 10 ** 9, 1, x, y)

if __name__ == '__main__':
    resolve()

Solution (Python):
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)

Solution (Python):
from math import *
s=int(input())
x1=ceil(sqrt(s))
if x1>10**9:
    x1-=1
y2=ceil(s/x1)
if y2>10**9:
    y2-=1
x2=x1*y2-s
print(0,0,x1,1,x2,y2)

Solution (Python):

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

Solution (Python):
def main():
    import sys
    input = lambda:sys.stdin.readline().strip()
    
    s = int(input())
    
    
    
    

    v = 10**9

    x = (v-s%v)%v
    y = (s+x)//v

    print(0,0,10**9,1,x,y)

if __name__=='__main__':
    main()

Solution (Python):
def main():
    import sys
    input = lambda:sys.stdin.readline().strip()
    
    s = int(input())

    v = 10**9

    x = (v-s%v)%v
    y = (s+x)//v

    print(0,0,10**9,1,x,y)

if __name__=='__main__':
    main()

Solution (Python):
import sys
import math

read = sys.stdin.read
readline = sys.stdin.buffer.readline

sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    S = int(input())
    x1 = math.ceil(S ** 0.5)
    x2 = x1 ** 2 - S
    print(0, 0, x1, 1, x2, x1)


if __name__ == '__main__':
    main()

Solution (Python):
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)

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

Solution (Python):
s = int(input())
if 10**9 >= s:
    print(0,0,s,0,0,1)
    exit()
x = int(s**0.5)
if x**2 >= s:
    t = x**2-s
    if t <= 10**9:
        print(0,0,x,1,t,x)
else:
    if x*(x+1) >= s:
        t = x*(x+1) -s
        if t <= 10**9:
            print(0,0,x,1,t,x+1)
    elif (x+1)**2 >= s:
        t = (x+1)**2 - s
        if t <= 10**9:
            print(0,0,x+1,1,t,x+1)

Solution (Python):
from math import sqrt, ceil
S = int(input())

"""
|x1y2 - x2y1| = S

"""

x1 = ceil(sqrt(S))
x2 = x1*x1 - S
print(0,0,x1,1,x2,x1)

Solution (Python):
from math import sqrt, ceil
S = int(input())

"""
|x1y2 - x2y1| = S

"""

x1 = ceil(sqrt(S))
x2 = x1*x1 - S
print(0,0,x1,1,x2,x1)

Solution (Python):




import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi,factorial
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]

def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

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

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

Solution (Python):
import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

tin=lambda : map(int, input().split())
lin=lambda : list(tin())
mod=1000000007



def cc(s):
	if s <= 10**9:
		r = [0,0,s,0,0,1]
		return r
		
	ok=10**9
	ng=1
	while ok-ng > 1:
		mid = (ok+ng)//2
		if mid * mid >= s:
			ok = mid
		else:
			ng = mid
	if ok*ok == s:
		r = [0,0,ok,0,0,ok]
		return r
		
	mx = ok
	ok = mx
	ng = 1
	while ok - ng > 1:
		mid = (ok+ng)//2
		if mx * mid >= s:
			ok = mid
		else:
			ng = mid
			
	if mx * ok == s:
		return [0,0,mx, 0, 0, ok]
		
	else:
		diff = (mx * ok) - s
		
		
		
		
		return [0,0,mx,1,diff, ok]
		
	
	
		
		

def main():
	s = int(input())
	
	
	ret = cc(s)
	print(*ret)
		
		
	
	
	

isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		
			
	ret = main()
	if ret is not None:
		print(ret)

Solution (Python):


def read_int():
    return int(input().strip())


def read_ints():
    return list(map(int, input().strip().split(' ')))


def solve():
    S = read_int() 
    
    
    low, high = 0, 10**9
    while high-low > 1:
        mid = low+(high-low)//2
        if 10**9*mid >= S:
            high = mid
        else:
            low = mid
    Y3 = high
    X3 = 10**9*Y3-S
    return 0, 0, 10**9, 1, X3, Y3


if __name__ == '__main__':
    print(*solve())

Solution (Python):
import math

S = int(input())
t = math.sqrt(S)
a = b = math.ceil(t)

if a*(b-1) >= S:
  b -= 1

d = a*b - S
if d == 0:
  c = 0
else:
  c = 1
print("0 0 {} {} {} {}".format(a, c, d, b))

Solution (Python):
def main():
    import sys

    def input(): return sys.stdin.readline().rstrip()

    s = int(input())
    i = int(s**0.5)
    while i*i < s:
        i+= 1
    r = i*i-s
    ans = [0, 0, i, r, 1, i]
    print(*ans)
        
        
if __name__ == '__main__':
    main()

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

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

Solution (Python):
import math
s = int(input())

"""
p1を原点、p2を10**9、1に固定する
S = 10**9*y3 - x3
v = 10**9 として
を満たすy3, x3を探せばよい
s%v = 0 - x3
s%v = v-x3
x3 = (v-s%v)%v 

s//v = y3 - x3//v
(s+x3)//v = y3
"""
v = 10**9
ans = [0] * 6
ans[0], ans[1] = 0, 0
ans[2], ans[3] = 10**9, 1
ans[4] = (v-s%v)%v
ans[5] = (s+ans[4])//v

print(' '.join(list(map(str, ans))))

Solution (Python):
d=int(input())
s=int(d**0.5)
if s*s!=d:
    s+=1
t=s*s-d
for i in range(int(t**0.5)+3,0,-1):
    if t%i==0:
        print(s,i,t//i,s,0,0)
        break

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

Solution (Python):
import numpy as np
def solve(s):
    h = int(np.sqrt(s))
    if h**2 < s:
        h += 1
    d = h**2 - s
    if d == 0:
        x, y = 0, 0
    else:
        x, y = 1, d
    return " ".join(map(str, [0,0,x,h,h,y]))

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

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

Solution (Python):


def main():
    S = int(input())

    x1, y1 = 0, 0
    x2, y2 = 10**9, 1

    x3 = (x2 - (S % x2)) % x2
    y3 = (S + x3) // x2

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


if __name__ == "__main__":
    main()

Solution (Python):
S = int(input())

x1 = 10 ** 9
y1 = 1

x2 = 10 ** 9 - S % (10 ** 9)
y2 = S // (10 ** 9) + 1

if S == 10 ** 18:
    x1, y1 = 10 ** 9, 0
    x2, y2 = 0, 10 ** 9

print('0 0 {0} {1} {2} {3}'.format(x1, y1, x2, y2))

Solution (Python):
S = int(input())
from math import sqrt, ceil
rtS = sqrt(S)
u = 10 ** 9
ans = [0 for _ in range(6)]
ans[2] = u
ans[3] = 1
ans[5] = ceil(S/u)
ans[4] = ans[5] * u - S
print(*ans)

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

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')


def resolve():
    s = int(input())
    x0, y0 = 0, 0
    if s % (10 ** 9) == 0:
        x1, y1 = 10 ** 9, 0
    else:
        x1, y1 = 10 ** 9, 1

    y2 = (s + x1 - 1) // x1
    x2 = 10 ** 9 - s % x1
    print(x0, y0, x1, y1, x2, y2)
    


if __name__ == '__main__':
    resolve()

Solution (Python):





import math
import fractions
import sys
import bisect
import heapq  
import collections
from collections import Counter
from collections import deque
import pprint
import itertools

sr = lambda: input()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""


def factorization(n):
    arr = []
    temp = n
    if n == 1:
        return arr

    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 power(a, n, mod):
    x = 1
    while n:
        if n & 1:
            x *= a % mod
        n >>= 1
        a *= a % mod
    return x % mod



def kaijo(n, l, mod):
    if n == 0:
        return 1
    a = n
    tmp = n - 1
    while (tmp >= l):
        a = a * tmp % mod
        tmp -= 1
    return a


class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


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


inf = 10 ** 18
mod = 10 ** 9 + 7

s = ir()
if int(math.sqrt(s))**2 == s:
    print(*[0,0,int(math.sqrt(s)),0,0,int(math.sqrt(s))], sep=' ')
else:
    x1 = int(math.sqrt(s))+1
    y2 = x1
    x2 = 0
    y1 = 0

    while y2 <= 10**9:
        pre = x1*y2 - s
        if 0<=pre<=10**9:
            x2 = 1
            y1 = pre
            break
        y2+=1
    print(*[0,0,x1,y1,x2,y2], sep=' ')

Solution (Python):
from math import ceil,floor,comb,factorial,gcd,pow,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from queue import Queue,LifoQueue,PriorityQueue
from copy import deepcopy
from time import time
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

s = INT()
y = ceil(s/10**9)
x = y*10**9 - s
print(0,0,10**9,1,x,y)

Solution (Python):
from math import ceil,floor,comb,factorial,gcd,pow,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from queue import Queue,LifoQueue,PriorityQueue
from copy import deepcopy
from time import time
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

s = INT()
if s == 10**18:
    print(0,0,10**9,0,0,10**9)
elif s <= 10**9:
    print(0,0,1,0,0,s)
else:
    x = s // 10**9 + 1
    y = s % 10**9
    print(1,0,x,y,0,10**9)

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7
from decimal import *

S = INT()

def make_divisors(n):  
    for i in range(ceil(n**0.5), 0, -1):
    	if n%i == 0:
    		if i <= 10**9 and n//i <= 10**9:
    			return i, n//i
	
a = ceil(S**0.5)
b = ceil(S**0.5)

if a*b == S:
	c = d = 0
else:
	c, d = make_divisors(a*b-S)

print(0, 0, a, c, d, b)

Solution (Python):
import sys
import itertools

import time
import math
import heapq
from collections import defaultdict
sys.setrecursionlimit(10 ** 7)
 
INF = 10 ** 18
MOD = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines



S = int(input())

x1 = 0
y1 = 0
x2 = -1
y2 = 0
x3 = 1
y3 = -1



l = round(math.sqrt(S))
x2 = l
y3 = l
while x2 * y3 < S:
    y3 += 1

if x2 * y3 != S:
    y2 = x2 * y3 - S

print(x1, y1, x2, y2, x3, y3)

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7 

from decimal import *



S = INT()

X1 = 10**9
Y1 = 1


Y2 = -(-S//X1)
X2 = X1*Y2 - S

print(0, 0, X1, Y1, X2, Y2)

Solution (Python):
s = int(input())
x1 = 0
a = 10**9
c = 1
y1 = 0
b = 0
d = 0
t = s//(10**9)
if s%10**9==0:
  d = s//10**9
  print(x1,y1,a,b,c,d)
  exit()
d = t+1
b = 10**9-s%(10**9)
print(x1,y1,a,b,c,d)

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

Solution (Python):

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

Solution (Python):

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

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(200000)
import math
from collections import Counter


def read():
    S = int(input().strip())
    return S,


def solve(S):
    C = 10**9
    p, q = divmod(S, 10**9)
    if q == 0:
        ans = 0, 0, 0, p, 10**9, 1
    else:
        ans = 0, 0, 10**9-q, p+1, 10**9, 1
    print(*ans)


if __name__ == '__main__':
    inputs = read()
    solve(*inputs)

Solution (Python):
import sys
from collections import defaultdict

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

in_n = lambda: int(readline())
in_nn = lambda: map(int, readline().split())
in_nl = lambda: list(map(int, readline().split()))
in_na = lambda: map(int, read().split())
in_s = lambda: readline().rstrip().decode('utf-8')


def main():

    S = in_n()
    M = 10**9
    x1, y1 = 0, 0
    x2, y2 = M, 1
    q, r = divmod(S, M)
    if r == 0:
        x3, y3 = r, q
    else:
        x3, y3 = M - r, q + 1

    
    print(x1, y1, x2, y2, x3, y3)


if __name__ == '__main__':
    main()

Solution (Python):
def main():
    S = int(input())
    x1, y1 = (0, 0)
    x2, y2 = (10**9, 1)

    x3 = (x2 - S%x2)%x2
    y3 = (S+x3)//x2

    print(x1, y1, x2, y2, x3, y3)

if __name__ == "__main__":
    main()

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

Solution (Python):
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log,gcd
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')



 
import numpy as np
from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson
from scipy.sparse import csr_matrix

 

def ii(): return int(sys.stdin.readline().rstrip()) 
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) 
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]

def ss(): return sys.stdin.readline().rstrip() 
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) 
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]





s=ii()

if s<10**9:
    a,b=s,0
else:
    if s%(10**9)==0:
        a,b=0,s//(10**9)
    else:
        a,b=10**9-(s%(10**9)),s//(10**9) +1

print(0,0,10**9,1,a,b)