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())
ten = len(str(S))-1
if S <= 10**9:
    print(S,0,1,1,0,0)
else:
    t = int(str(S)[-10::-1][::-1])+1
    if S == 10**18:
        t -= 1
    print(t,1,t*10**9-S,10**9,0,0)

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

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

Solution (Python):



def main():
    S = int(input())
    y = (S+10**9-1)//(10**9)
    x = y*(10**9)-S
    print(' '.join(map(str,[0,0,10**9,1,x,y])))

if __name__ == '__main__':
    main()

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

Solution (Python):
S = int(input())
ans = [0, 0, 10 ** 9, 1]
x = (10 ** 9 - S % 10 ** 9) % 10 ** 9
y = (S + x) // 10 ** 9
ans.append(x)
ans.append(y)
print(*ans)

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

Solution (Python):
def divisor(n):
    ass = []
    for i in range(1,int(n**0.5)+1):
        if n%i == 0:
            ass.append(i)
            if i**2 == n:
                continue
            ass.append(n//i)
    return ass 


def main():
    S = int(input())
    X1, Y1 = 0, 0
    Y2 = 1
    X2 = 10 ** 9
    Y3 = S // X2 if S % X2 == 0 else S // X2 + 1
    X3 = (10 ** 9) * Y3 - S


    print(X1,Y1,X2,Y2,X3,Y3)




if __name__ == "__main__":
    main()

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

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

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

if s < 10 ** 9:
    y3 = 0
    x3 = s
else:
    mod = s % 10 ** 9
    if mod == 0:
        y3 = s // 10 ** 9
        x3 = 0
    else:
        y3 = s // 10 ** 9 + 1
        x3 = 10 ** 9 - mod

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

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

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

Solution (Python):


def main():
    S = int(input())
    M = 10**9
    if S % M == 0:
        print(0,0,M,0,0,S//M)
    else:
        X = (S+M-1) // M
        a,b,c,d = M,1,M-S%M,X
        print(0,0,a,b,c,d)
        

if __name__ == "__main__":
    main()

Solution (Python):
import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    M=10**9
    S=I()
    if S<=M:
        print(0,0,0,S,1,0)
    else:
        
        x1y2=M-S%M
        if S%M==0:
            x1y2=0
        x1=x1y2
        y2=1
        x2=10**9
        y1=(S+x1y2)//M
        print(0,0,x1,y1,x2,y2)


main()

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

Solution (Python):
import sys
input = sys.stdin.readline

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

if __name__ == '__main__':
    main()

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

Solution (Python):
N = int(input())
a = N // (10**9)
b = N % (10**9)
if b != 0:
    print(0,0,1000000000,1,1000000000-b,a+1)
else:
    print(0,0,1000000000,0,0,a)

Solution (Python):






import sys
input = sys.stdin.readline

import math

import bisect
from collections import defaultdict
from collections import deque
from collections import Counter
from functools import lru_cache






MOD = 10**9+7
INF = float('inf')






def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]


def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()


def DD(arg): return defaultdict(arg)



def inv(n): return pow(n, MOD-2, MOD)


kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret


def factorization(n):
  arr = []
  temp = n
  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 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


def make_primes(N):
  max = int(math.sqrt(N))
  seachList = [i for i in range(2,N+1)]
  primeNum = []
  while seachList[0] <= max:
    primeNum.append(seachList[0])
    tmp = seachList[0]
    seachList = [i for i in seachList if i % tmp != 0]
  primeNum.extend(seachList)
  return primeNum


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


def lcm(a, b):
    return a * b // gcd (a, b)


def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count


def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i-1])*n**i for i in range(len(str(X))))


def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count





S = I()
a = 10**9
d = -(-S//a)
S = a*d-S

print(0,0,a,S,1,d)

Solution (Python):


















import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
s = I()
v = 10**9
x = (v - s%v) % v
y = (s + x)//v
print(0,0,10**9,1,x,y)

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

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

a = 10**9 - A % (10**9)
b = A // (10**9) + 1


if b > 10**9:
    print(0, 0, 10**9, 0, 0, 10**9)
else:
    print(0, 0, 10**9, 1, a, b)

Solution (Python):
import math

s = int(input())

mod = 10**9

if s <= mod:
    print(0, 0, 0, 1, s, 0)
else:
    x1, x2 = mod, 1
    y2 = math.ceil(s / mod)
    y1 = y2 * mod - s
    print(0, 0, x1, x2, y1, y2)

Solution (Python):
def main():
    s = int(input())
    p, q = divmod(-s, 10 ** 9)
    print(0, 0, 1, 10 ** 9, abs(p), q)


if __name__ == '__main__':
    main()

Solution (Python):

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

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

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

Solution (Python):
def f(x1, y1, x2, y2):
    return abs(x1*y2 - x2*y1)

def main():
    S = int(input())
    d = pow(10, 9)
    X1, Y1 = 0, 0
    X2, Y2 = d, 1
    X3 = (d - S%d)%d
    Y3 = (S + X3) // d
    print(X1, Y1, X2, Y2, X3, Y3)
    

if __name__ == "__main__":
    main()

Solution (Python):
def f(x1, y1, x2, y2):
    return abs(x1*y2 - x2*y1)

def main():
    S = int(input())
    d = pow(10, 9)
    X1, Y1 = 0, 0
    X2, Y2 = d, 1
    X3 = (d - S%d)%d
    Y3 = (S + X3) // d
    print(X1, Y1, X2, Y2, X3, Y3)
    

if __name__ == "__main__":
    main()

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

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

x1, x2, x3 = 0, 10 ** 9, 1
a = -(-s // (10 ** 9))
b = a * (10 ** 9) - s

y1, y2, y3 = 0, b, a

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

Solution (Python):
import sys

stdin = sys.stdin
inf = 1 << 60
mod = 1000000007

sys.setrecursionlimit(10**7)

ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
nf = lambda: float(ns())
nfn = lambda y: [nf() for _ in range(y)]
nfa = lambda: list(map(float, stdin.readline().split()))
nfan = lambda y: [nfa() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

s = ni()

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

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

Solution (Python):
N = 10 ** 9

def Z(): return int(input())
def ZZ(): return [int(_) for _ in input().split()]

def main():
    S = Z()
    x = (S + N - 1)//N
    y = N * x - S
    print(0, 0, 1, N, x, y)
    return

if __name__ == '__main__':
    main()

Solution (Python):
from math import sqrt,ceil

def cal_main(S):
    
    
    
    

    L = ceil(sqrt(S))
    for l in range(L,10**9+1):
        
        xb_ya = cal_sub(l**2-S)
        xb,ya = xb_ya[0],xb_ya[1]
        if 0 <= xb <= 10**9 and 0 <= ya <= 10**9:
            return [l,ya,xb,l,0,0]

def cal_sub(T):
    if T == 0:
        return [0,0]
    else:
        L = int(sqrt(T))
        for l in reversed(range(1,L+1)):
            if T % l == 0:
                return [l,T//l]

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

    ans = cal_main(S)
    print(" ".join(map(str,ans)))

if __name__ == "__main__":
    main()

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

if s==10**18:
  print(0,0,0,1000000000,1000000000,0)
  exit()

y=s//1000000000+1
x=1000000000*y-s


print(0,0,1000000000,1,x,y)

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce, lru_cache  
from fractions import gcd
import sys
def input(): return sys.stdin.readline().rstrip()
def I(): return int(input())
def Is(): return (int(x) for x in input().split())
def LI(): return list(Is())
def TI(): return tuple(Is())
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(S())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = 10**18


s = I()
a = s//10**9
b = s % 10**9

if a+1 > 10**9:
    print(0, 0, 10**9, 0, 0, 10**9)
else:
    print(0, 0, 10**9, 10**9-b, 1, a+1)

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

main()

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

Y = S//(10**9)+1
X = 10**9 * Y - S

if S==10**18:
    Y = 10**9
    X = 0

print(*[0, 0, 10**9, 1, X, Y])

Solution (Python):
import math
def main():
    S = int(input())
    t = int(math.sqrt(S))
    if t * t == S:
        print("0 0", t, "0 0", t)
        return
    x = (t+1) * (t+1) - S
    print("0 0 1", t+1, t+1, x)
    return
main()

Solution (Python):











import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log 
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 fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    S = I()
    y = ceil(S,10**9)
    x = 10**9*y - S
    print(0,0,10**9,1,x,y)

if __name__ == '__main__':
    main()

Solution (Python):
from math import ceil

s = int(input())
a = ceil(s / 10**9)
b = 10**9*a - s
print(*[0, 0, 10**9, b, 1, a])

Solution (Python):
import math

s = int(input())

x1 = math.ceil(math.sqrt(s))
y1 = 1
x2 = x1**2 - s
y2 = x1
x3 = 0
y3 = 0

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

Solution (Python):
import math
S = int(input())
 
x1 = math.ceil(math.sqrt(S))
y1 = 1
x2 = x1 ** 2 - S
y2 = x1
x3 = 0
y3 = 0
 
print(x1, y1, x2, y2, x3, y3)

Solution (Python):
import sys
input=sys.stdin.readline

s=int(input())




if s<=10**9:
    print(0,0,1,0,0,s)
    exit()

y=(-1*s//(10**9))*(-1)
x=10**9*y-s

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

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

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

    print()

Solution (Python):
import math

S = int(input())

sqrtS = math.ceil(math.sqrt(S))
rest = sqrtS*sqrtS - S

X1,Y1 = 0,0
X2,Y2 = sqrtS, 1
X3,Y3 = rest, sqrtS
print("{} {} {} {} {} {}".format(X1,Y1,X2,Y2,X3,Y3))

Solution (Python):
import math

S = int(input())

sqrtS = math.ceil(math.sqrt(S))
rest = sqrtS*sqrtS - S

X1,Y1 = 0,0
X2,Y2 = sqrtS, 1
X3,Y3 = rest, sqrtS
print("{} {} {} {} {} {}".format(X1,Y1,X2,Y2,X3,Y3))

Solution (Python):
import sys


import math
import collections



import fractions

import copy
import heapq
import decimal

import queue

sys.setrecursionlimit(10000001)
INF = 10 ** 16
MOD = 10 ** 9 + 7

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))





def main():
    s = ni()

    deka = 10 ** 9
    x1 = s // deka
    tmp = s % deka

    if tmp:
        y1 = deka - tmp
    else:
        x1 -= 1
        y1 = 0

    print(x1 + 1, y1, 1, deka, 0, 0)


if __name__ == '__main__':
    main()

Solution (Python):
from math import ceil
S=int(input())
 
if S<=10**9:
  d=0
  c=S
else:
  d=ceil (S/(10**9))
  c=10**9*d-S
 
print(0,0,10**9,1,c,d)

Solution (Python):


def main():
    s = int(input())
    if s <= 10 ** 9:
        x1 = s
        y2 = 1
        y1 = 0
        x2 = 0
    elif s < 10 ** 18:
        u, d = divmod(s, 10**9)
        x1 = u + 1
        y2 = 10 ** 9
        y1 = 10 ** 9 - d
        x2 = 1
    else:
        x1 = 10 ** 9
        y2 = 10 ** 9
        y1 = 0
        x2 = 0

    print(0, 0, x1, y1, x2, y2)

if __name__ == '__main__':
    main()

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

if S<=10**9:
  d=0
  c=S
else:
  d=ceil (S/(10**9))
  c=10**9*d-S

print(0,0,10**9,1,c,d)

Solution (Python):
import bisect
import copy
import heapq
import math
import sys
from collections import *
from itertools import accumulate, combinations, permutations, product

def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

s=int(input())


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

Solution (Python):
import bisect
import copy
import heapq
import math
import sys
from collections import *
from itertools import accumulate, combinations, permutations, product

def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

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 main():
    S = int(input())
    x1, y1 = 0, 0
    if S < 10**18:
        x2, y2 = 10**9, 1
        y3 = S // x2 + 1
        x3 = x2 * y3 - S
    else:
        x2, y2 = 10**9, 0
        x3, y3 = 0, 10**9
    print(' '.join(map(str, [x1, y1, x2, y2, x3, y3])))


if __name__ == '__main__':
    main()

Solution (Python):
def agc036_a():
    S = int(input())
    x1 = y1 = 0
    x2 = 10**9
    y2 = 1
    d, m = divmod(S, x2)
    if m == 0:
        y2 = x3 = 0
        y3 = d
    else:
        x3 = x2 - m
        y3 = d + 1
    ans = [x1, y1, x2, y2, x3, y3]
    print(*ans, sep=' ')

agc036_a()

Solution (Python):
s = int(input())
if s <= 10**9:
  print(0,0,s,1,0,1)
elif s == 10**18:
  print(0,0,10**9,0,0,10**9)
else:
  m = s//10**9+1
  a = 10**9-s%10**9
  print(0,0,m,1,a,10**9)

Solution (Python):
n = int(input())
N = 10**9
x1=0
y1=0
x2=N
y2=1
x3=N-n%N
y3=n//N+1
if n==10**18:
    x3=0
    y3=n//N

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

Solution (Python):
import sys

def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list(map(lambda x: x-1, MII()))

def DD2(d1,d2,init=0): return [[init]*d2 for _ in range(d1)]
def DD3(d1,d2,d3,init=0): return [DD2(d2,d3,init) for _ in range(d1)]

def to_bin(x: int) -> str: return format(x,'b') 
def to_oct(x: int) -> str: return format(x,'o') 
def to_hex(x: int) -> str: return format(x,'x') 
def divc(x,y) -> int: return -(-x//y)
def divf(x,y) -> int: return x//y
def gcd(x,y):
    while y: x,y = y,x%y
    return x
def lcm(x,y): return x*y//gcd(x,y)
def enumerate_divs(n):
    """Return a tuple list of divisor of n"""
    return [(i,n//i) for i in range(1,int(n**0.5)+1) if n%i==0]
def get_primes(n=10**3):
    """Return a list of prime numbers n or less"""
    is_prime = [True]*(n+1)
    is_prime[0] = is_prime[1] = False
    for i in range(2, int(n**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i*2, n+1, i): is_prime[j] = False
    return [i for i in range(n+1) if is_prime[i]]
def prime_factor(n):
    """Return a list of prime factorization numbers of n"""
    res = []
    for i in range(2,int(n**0.5)+1):
        while n%i==0: res.append(i); n //= i
    if n != 1: res.append(n)
    return res

MOD=10**9+7

import itertools as it
import functools as ft
from collections import deque, Counter
from heapq import heapify, heappop, heappush
from bisect import bisect_left

def main():
    s = II()
    m = 10**9
    x3 = (m-s%m)%m
    y3 = (s+x3)//m
    print(0, 0, m, 1, x3, y3)

if __name__ == '__main__':
    main()

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())
if round(s**0.5)**2==s:
    tmp = round(s**0.5)
    print(0, 0, tmp, 0, 0, tmp)
    exit()
i = int(s**0.5)+1
for j in range(i, 0, -1):
    if i*j<s:
        print(0, 0, i, 1, i*(j+1)-s, j+1)
        break

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    n=int(input())
    print(0,0,10**9,1,-10**9*(-n//10**9)-n,-(-n//10**9))
if __name__=='__main__':
    main()

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

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

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

xl = int(s ** 0.5) + 1
if (xl - 1) * (xl - 1) >= s:
  xl -= 1
  yl = xl
elif (xl - 1) * xl >= s:
  yl = xl - 1
else:
  yl = xl

diff = xl * yl - s
print(*[0, 0, xl, diff, 1, yl])

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

xl = int(s ** 0.5) + 1
if (xl - 1) * xl >= s:
  yl = xl - 1
  if (xl - 1) * (xl - 1) >= s:
    xl -= 1
else:
  yl = xl

diff = xl * yl - s
print(*[0, 0, xl, diff, 1, yl])

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

Solution (Python):
import math 
s=int(input())
if s<=10**9:
    print(0,0,1,0,0,s)
else:
    b=int(math.ceil(s/10**9))
    a=10**9*b-s
    print(0,0,10**9,1,a,b)

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

Solution (Python):
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 resolve():
    '''
    code here
    '''
    S = int(input())

    a, b = divmod(S, 10**9)
    x2 = (10**9 - b)%10**9
    y2 = (S+x2) // (10**9)

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

if __name__ == "__main__":
    resolve()

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

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

Solution (Python):


S = int(input())
x1 = 0
y1 = 0
x2 = 1000000000
y2 = 1
v = 1000000000
x = (v - S % v) % v
y = (S + x) // v

print("{} {} {} {} {} {}".format(x1, y1, x2, y2, x, y))

Solution (Python):
s = int(input())
import math
k = math.floor(s**0.5)
m = 0
if s == 10**18:
    print(10**9,0,0,10**9,0,0)
else:
    if k**2+k < s:
        m = (k+1)**2 -s
        print(k+1,1,m,k+1,0,0)
    else:
        m = k*(k+1)-s
        print(k+1,1,m,k,0,0)

Solution (Python):


s = int(input())

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

y3 = (s + x2 -1) // x2
x3 = x2 * y3 - s
print(x1, y1, x2, y2, x3, y3)

Solution (Python):
import math
s = int(input())
x1 = 0
y1 = 0
x2 = 10**9
y3 = math.ceil(s/10**9)
y2 = 1
x3 = x2*y3-s

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

Solution (Python):
import sys

input = sys.stdin.readline


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

    
    
    
    
    
    
    q, r, = divmod(S, 10**9)
    if r == 0:
        X = 0
        Y = q
    else:
        X = 10**9 - r
        Y = q + 1
    ans = [0, 0, 10**9, 1, X, Y]
    print(*ans)


if __name__ == "__main__":
    main()

Solution (Python):
def main():
  s=int(input())
  max=pow(10,9)
  if s<=max:
    x1,y1,x2,y2,x3,y3=0,0,s,0,s,1
  elif s%max==0:
    x1,y1,x2,y2,x3,y3=0,0,max,0,max,s//max
  else:
    a=s%max
    b=s//max
    x1,y1,x2,y2,x3,y3=0,0,max, 1,max-a,b+1
  print(x1,y1,x2,y2,x3,y3)
  
def ss(x2,y2,x3,y3):
  return x2*y3-x3*y2
if __name__=='__main__':
  main()

Solution (Python):
S = int(input())
v = 10**9

y = S//v + (S < 10**18)
x = v*y - S

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

Solution (Python):
import sys
input = lambda : sys.stdin.readline().rstrip()

import sys
sys.setrecursionlimit(max(1000, 10**9))


s = int(input())
x1, y1 = 0, 0

k = int(s**0.5) - 2
while k<0 or k*k<s:
    k += 1
k -= 1

if k*k==s:
    x2, y3 = k, k
    x3, y2 = 0, 0
elif k*(k+1)>=s:
    x2, y3 = k, k+1
    x3, y2 = 1, (x2*y3 - s)
else:
    x2, y3 = k+1, k+1
    x3, y2 = 1, (x2*y3 - s)
print(" ".join(map(lambda x: str(int(x)), [x1, y1, x2, y2, x3, y3])))

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

X1 = Y1 = 0
X2 = 10**9; Y2 = 1
if S % (10**9) == 0:
    X3 = 0
else:
    X3 = 10**9 - S%(10**9)

Y3 = (S + X3) // (10**9)

print(X1, Y1, X2, Y2, X3, Y3)

Solution (Python):



def main():
  s = int(input())
  remain   = - s % (10**9) % (10**9)
  quotient = (s + remain) // (10**9)
  print(0, 0, 1, 10**9, quotient, remain)
  
if __name__=='__main__':
  main()

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

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

Solution (Python):
def main(s):
    
    a=10**9
    if s<=10**9:
        x1,y1,x2,y2,x3,y3=0,0,s,0,0,1
    elif s%a==0:
        x1,y1,x2,y2,x3,y3=0,0,a,0,a,s//a
    else:
        x1,y1=0,0
        x2,y2=s//a+1,a-s%a
        x3,y3=1,a
    print(x1,y1,x2,y2,x3,y3)
if __name__=='__main__':
    s=int(input())
    main(s)

Solution (Python):
S = int(input())
x1, y1 = 0, 0
x2, y2 = 10 ** 9, 1
y3 = S // (10 ** 9) + 1
x3 = 10 ** 9 * y3 - S
if (S == 10 ** 18):
    print(0, 0, 10**9, 0, 0, 10**9)
else:
    print(x1, y1, x2, y2, x3, y3)

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

s=ceil(sqrt(S))
adit=pow(s,2)-S
a=0
b=0

n=ceil(sqrt(adit))

primes = set(range(2, n+1))
for i in range(2, int(n**0.5+1)):
    primes.difference_update(range(i*2, n+1, i))
primes=list(primes)
primes.sort(reverse=True)
primes.append(1)

for i in primes:
    if adit%i==0:
        a=i
        b=adit//i
        break



if n==0:
    print(0,0,s,0,0,s)
else:
    print(0,0,a,s,s,b)

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

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

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

Solution (Python):
import sys

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


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

    x3 = (-s) % (10 ** 9)
    y3 = (s + x3) // (10 ** 9)

    print(0, 0, 10 ** 9, 1, x3, y3)


if __name__ == '__main__':
    resolve()

Solution (Python):
import math

s = int(input())

rot = int(math.sqrt(s) // 1)
if s == rot**2:
    print("0 0 " + str(rot) + " 0 0 " + str(rot))
    exit()

rot += 1
ans = (rot**2) - s
print("0 0 " + str(rot) + " 1 " + str(ans) + " " + str(rot))

Solution (Python):
import sys
import math  
import bisect  
import queue  


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


if __name__ == '__main__':
    S = int(input())

    x1, y1 = 0, 0
    x2, y2 = 1000000000, 1
    y3 = math.ceil(S / 1000000000)
    x3 = x2 * y3 - S
    print('{} {} {} {} {} {}'.format(x1, y1, x2, y2, x3, y3))

Solution (Python):
import sys
import math  
import bisect  
import queue  


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


if __name__ == '__main__':
    S = int(input())

    x1, y1 = 0, 0
    x2, y2 = 1000000000, 1
    x3 = (x2 - S % x2) % x2
    y3 = (S + x3) // x2
    print('{} {} {} {} {} {}'.format(x1, y1, x2, y2, x3, y3))

Solution (Python):
import math
s = int(input())
t = int(math.sqrt(s) // 1)
if s == t**2:
    print(0, 0, 0, t, t, 0)
else:
    t += 1
    e = t * t - s
    print(0, 0, t, e, 1, t)

Solution (Python):
import math
s = int(input())
t = int(math.sqrt(s) // 1)
if s == t**2:
    print(0, 0, 0, t, t, 0)
else:
    t += 1
    e = t * t - s
    print(0, 0, t, e, 1, t)

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    S = int(rl())
    x1, y1 = 0, 0
    x2, y2 = 1000000000, 1
    x3 = (x2 - S % x2) % x2
    y3 = (S + x3) // x2
    print('{} {} {} {} {} {}'.format(x1, y1, x2, y2, x3, y3))


if __name__ == '__main__':
    solve()

Solution (Python):
s = int(input())
p = 10 ** 9
xp = s % p
yp = s // p
x = p - xp
y = yp + 1

if s != 10 ** 18:
    print(0,0,p,1,x,y)
else:
    print(0,0,p,0,0,p)

Solution (Python):
INF = 10 ** 9
import sys
sys.setrecursionlimit(100000000)
dy = (-1,0,1,0)
dx = (0,1,0,-1)
from  heapq import heappop,heapify,heappush
from bisect import bisect_left

def main():
    s = int(input())
    a = int(s ** 0.5)
    while (a + 1) * (a + 1) <= s:
        a += 1

    b,c = 0,0
    flag = False
    while a <= INF:
        tmp = a * a - s
        if tmp == 0:
            b,c = 0,0
            break
        for i in range(1,tmp):
            if tmp%i == 0:
                j = tmp//i
                if i <= INF and j <= INF:
                    b = i
                    c = j
                    flag = True
                    break
        if flag:
            break
        else:
            a += 1
        
    print(0,0,a,c,b,a)
if __name__ == '__main__':
    main()

Solution (Python):
import math
S = int(input())
L = 10**9

def search():
    p = int(math.sqrt(S))
    q = p
    i = 0
    while p*q < S:
        if i % 2 == 0 or q == L: p += 1
        if i % 2 == 1 or p == L: q += 1
        i += 1
    assert p <= L and q <= L
    target = p*q - S
    divisor = 1
    
    return (0, 0, p, divisor, target, q)

print(*search())

Solution (Python):







S=int(input())
if S==10**18:
  print(0,0,10**9,0,0,10**9)
  exit(0)
DIV=10**9
a = S//DIV
b = S%DIV
x = 10**9-b
y = a + 1
if x>10**9:
  print(x)
if y>10**9:
  print(y)
print(0,0,10**9,1,x,y)

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

Solution (Python):
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

MOD = 1000000007

def smax(a,b):
    if a>b:
        return a
    else:
        return b

def smin(a,b):
    if a<b:
        return a
    else:
        return b

def main():
    S = int(readline())
    if S!=10**18:
        a = S%1000000000
        b = S//1000000000
        x1 = 1000000000
        y2 = b
        x2 = a
        y1 = -1
        print(0,1,x1,1+y1,x2,1+y2)
    else:
        print(0,0,1000000000,0,0,1000000000)


if __name__ == '__main__':
    main()

Solution (Python):
import math
N = input()
l = len(N)
N =int(N)
a = b  =0

    
    
    
MAX = 10 ** 9
for i in range(0,19):
    juu = 10 ** i
    dived = math.ceil(N / juu)
    
    x1 = dived
    y2 = juu
    x2 = dived * juu - N
    y1 = 1

    
    if MAX >= x1 >= 0 and MAX >= x2 >= 0 and MAX >= y1 >= 0 and MAX >= y2 >= 0 :
        print(a, b, x1, y1, x2,y2)
        exit(0)