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):



import sys  
import os
import time
import re
from pydoc import help
import string
import math
from operator import itemgetter
from collections import Counter
from collections import deque
from collections import defaultdict as dd
import fractions
from heapq import heappop, heappush, heapify
import array
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy as dcopy
import itertools



sys.setrecursionlimit(10**7)
INF = 10**20
GOSA = 1.0 / 10**10
MOD = 10**9+7
ALPHABETS = [chr(i) for i in range(ord('a'), ord('z')+1)]  
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def DP(N, M, first): return [[first] * M for n in range(N)]
def DP3(N, M, L, first): return [[[first] * L for n in range(M)] for _ in range(N)]
from inspect import currentframe


def local_input():
    from pcm.utils import set_stdin
    import sys
    from pathlib import Path
    parentdir = Path(os.path.dirname(__file__)).parent
    inputfile = parentdir.joinpath('test/sample-1.in')
    if len(sys.argv) == 1:
        set_stdin(inputfile)


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

    if s <= 10**9:
        print(0,0,1,0,0,s)
    elif s == 10**18:
        print(0,0,10**9,0,0,10**9)
    else:
        c = s // (10**9)
        b = c+1
        a = s % 10**9
        print(0,c,a,0,10**9,b)
    return 0

if __name__ == "__main__":
    try:
        local_input()
        def dump(*args):
            names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}
            print(', '.join(names.get(id(arg),'???')+' => '+repr(arg) for arg in args), file=sys.stderr)
    except:
        def dump(*args):
            pass

    solve()

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

Solution (Python):
import math

s = int(input())
a = math.floor(math.sqrt(s))
if a * a == s:
    a -= 1
b = a if s <= a * (a + 1) else a + 1
print(0, 1, b, 0, s - a * b, a + 1)

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

def getN():
    return int(input())
def getList():
    return list(map(int, input().split()))
import math

s =getN()


app = math.floor(math.sqrt(s - 1)) + 1
if app > 10**9:
    app = 10 ** 9
mx = app**2

sabun = mx - s

h = app
w = app
if sabun >= w:
    h -= sabun // w
    sabun -= (sabun // w) * w

print(0, 0, w, 1, sabun, h)

Solution (Python):
import math


def main():
    S = int(input())
    a = math.ceil(math.sqrt(S))
    if a * a == S:
        print(0, 0, a, 0, 0, a)
        return
    if a ** 2 - S <= int(1e9):
        d = a
        b = 1
        c = a**2 - S
    else:
        d = a - 1
        b = 1
        c = a*d - S
    print(0, 0, a, b, c, d)


if __name__ == "__main__":
    main()

Solution (Python):
from fractions import gcd

from math import factorial as f

from math import ceil,floor,sqrt

from sys import exit

from copy import deepcopy
import numpy as np

import bisect


def main():
    s = int(input())
    n = ceil(sqrt(s))
    b = n**2
    sm = n*(n-1)


    rest = 0

    if sm >= s:
        x1 = n
        y2 = n-1
        rest = sm-s
    else:
        x1 = n
        y2 = n
        rest = b-s
    

    print(0,0,x1,rest,1,y2)



main()

Solution (Python):
import math
S=int(input())
a=math.ceil(math.sqrt(S))
b=math.ceil(math.sqrt(S))*math.ceil(math.sqrt(S))-S

print(0, 0, a, b, 1, a)

Solution (Python):
S = int(input())
a = S // 10 ** 9
b = S % 10 ** 9

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

Solution (Python):


from math import sqrt
def main():
    S = int( input())
    x = 10**9
    y = (S+x-1)//x
    s = 1
    t = x*y-S
    print(0,0,x,s,t, y)
if __name__ == '__main__':
    main()

Solution (Python):


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

S = int(input())

import math

tar = math.sqrt(S)
if int(tar) == tar:
    x2y1 = 0
    x1 = y2 = int(tar)
else:
    x2y1 = (int(tar) + 1) ** 2 - S
    x1 = y2 = int(tar) + 1

tmp = x2y1
x2 = 1
for p in range(int(x2y1) + 1):
    if x2 <= 10 ** 9 and (x2y1 // x2) <= 10 ** 9: break
    elif tmp % p > 0: continue
    
    for i_p in range(1, 65):
        if tmp % (p ** (i_p + 1)) > 0: break
    x1 *= (p ** i_p)

y1 = x2y1 // x2
print(0, 0, x1, y1, x2, y2)

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

X1 = 0
Y1 = 0

tmp = int(S**0.5)
if tmp**2 >= S:
    X2 = Y3 = tmp
else:
    X2 = Y3 = tmp+1

rest = X2**2 - S

if rest == 0:
    X3 = Y2 = 0
else:
    if rest < 10**9:
        X3 = 1
        Y2 = rest
    else:
        for i in range(2, int(rest**0.5)+2):
            if rest % i == 0:
                X3 = i
                Y2 = rest // i

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

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

x3, y3 = 0, 0
y1 = 1
y2 = 10**9
x1, m = divmod(S, y2)
x1 += 1
x2 = x1*y2 - S
if S==10**18:
    x1,y1,x2,y2 = y2,0,y2,y2
print(x1,y1,x2,y2,x3,y3)

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

hoge = math.sqrt(S)
hoge = math.ceil(hoge)
onon = hoge ** 2 - S
hogehoge = onon
hogehoge2 = 1
for i in range(2, 10*9):
    if onon % i == 0:
        hogehoge = onon // i
        hogehoge2 = i
        break

print("0 0 " + str(hogehoge) + " " + str(hoge) + " " + str(hoge) + " " + str(hogehoge2))

Solution (Python):
import math


s = int(input())

nanka = math.ceil(math.sqrt(s))
ss = nanka*nanka - s


print(nanka,1,ss,nanka,0,0)

Solution (Python):


def main():
    M = int(10**9)

    S = int(input())

    if S == M**2:
        print(0, 0, M, 0, 0, M)
    else:
        m = S%M

        x2 = 1
        y1 = M - m
        x1 = M
        y2 = (S + (M - m))//M

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


if __name__ == '__main__':
    main()

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

hoge = math.sqrt(S)
hoge = math.ceil(hoge)
onon = hoge ** 2 - S
hogehoge = onon
hogehoge2 = 1
for i in range(2, 10*9):
    if onon % i == 0:
        hogehoge = onon // i
        hogehoge2 = i
        break

print("0 0 " + str(hogehoge) + " " + str(hoge) + " " + str(hoge) + " " + str(hogehoge2))

Solution (Python):
def main():

    """ convenient functions
    
    
    
    
    
    """

    """convenient decorator
    
    
        
        
        
        
        
        
        
        
        
        
    """
    
    
    import sys
    sys.setrecursionlimit(10**7)
    from itertools import accumulate, combinations, permutations, product 
    
    from math import factorial, ceil, floor, sqrt
    def factorize(n):
        """return the factors of the Arg and count of each factor
        
        Args:
            n (long): number to be resolved into factors
        
        Returns:
            list of tuples: factorize(220) returns [(2, 2), (5, 1), (11, 1)]
        """
        fct = []  
        b, e = 2, 0  
        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
    def combinations_count(n, r):
        """Return the number of selecting r pieces of items from n kinds of items.
        
        Args:
            n (long): number
            r (long): number
        
        Raises:
            Exception: not defined when n or r is negative
        
        Returns:
            long: number
        """
        
        if n < 0 or r < 0:
            raise Exception('combinations_count(n, r) not defined when n or r is negative')
        if n - r < r: r = n - r
        if r < 0: return 0
        if r == 0: return 1
        if r == 1: return n
        numerator = [n - r + k + 1 for k in range(r)]
        denominator = [k + 1 for k in range(r)]
        for p in range(2,r+1):
            pivot = denominator[p - 1]
            if pivot > 1:
                offset = (n - r) % p
                for k in range(p-1,r,p):
                    numerator[k - offset] /= pivot
                    denominator[k] /= pivot
        result = 1
        for k in range(r):
            if numerator[k] > 1:
                result *= int(numerator[k])
        return result
    def combinations_with_replacement_count(n, r):
        """Return the number of selecting r pieces of items from n kinds of items allowing individual elements to be repeated more than once.
        
        Args:
            n (long): number
            r (long): number
        
        Raises:
            Exception: not defined when n or r is negative
        
        Returns:
            long: number
        """
        if n < 0 or r < 0:
            raise Exception('combinations_with_replacement_count(n, r) not defined when n or r is negative')
        elif n == 0:
            return 1
        else:
            return combinations_count(n + r - 1, r)
    from bisect import bisect_left, bisect_right
    from collections import deque, Counter, defaultdict 
    from heapq import heapify, heappop, heappush, heappushpop, heapreplace,nlargest,nsmallest 
    from copy import deepcopy, copy 
    import operator
    from operator import itemgetter
    
    
    from functools import reduce, lru_cache
    def chmin(x, y):
        """change minimum
        if x > y, x = y and return (x, True).
        convenient when solving problems of dp[i]
        
        Args:
            x (long): current minimum value
            y (long): potential minimum value
        
        Returns:
            (x, bool): (x, True) when updated, else (x, False)
        """
        if x > y:
            x = y
            return (x, True)
        else:
            return (x, False)
    def chmax(x, y):
        """change maximum
        if x < y, x = y and return (x, True).
        convenient when solving problems of dp[i]
        
        Args:
            x (long): current maximum value
            y (long): potential maximum value
        
        Returns:
            (x, bool): (x, True) when updated, else (x, False)
        """
        if x < y:
            x = y
            return (x, True)
        else:
            return (x, False)

    from fractions import gcd 
    def gcds(numbers):
        return reduce(gcd, numbers)
    def lcm(x, y):
        return (x * y) // gcd(x, y)
    def lcms(numbers):
        return reduce(lcm, numbers, 1)

    
    
    INF = 10 ** 18
    MOD = 10 ** 9 + 7
    modpow = lambda a, n, p = MOD: pow(a, n, p) 
    def modinv(a, p = MOD):
        
        
        return modpow(a, p-2, p)
    def modinv_list(n, p = MOD):
        if n <= 1:
            return [0,1][:n+1]
        else:
            inv_t = [0,1]
            for i in range(2, n+1):
                inv_t += [inv_t[p % i] * (p - int(p / i)) % p]
            return inv_t
    def modfactorial_list(n, p = MOD):
        if n == 0:
            return [1]
        else:
            l = [0] * (n+1)
            tmp = 1
            for i in range(1, n+1):
                tmp = tmp * i % p
                l[i] = tmp
            return l
    def modcomb(n, k, fac_list = [], p = MOD):
        
        
        from math import factorial
        if n < 0 or k < 0 or n < k: return 0
        if n == 0 or k == 0: return 1
        if len(fac_list) <= n:
            a = factorial(n) % p
            b = factorial(k) % p
            c = factorial(n-k) % p
        else:
            a = fac_list[n]
            b = fac_list[k]
            c = fac_list[n-k]
        return (a * modpow(b, p-2, p) * modpow(c, p-2, p)) % p
    def modadd(a, b, p = MOD):
        return (a + b) % MOD
    def modsub(a, b, p = MOD):
        return (a - b) % p
    def modmul(a, b, p = MOD):
        return ((a % p) * (b % p)) % p
    def moddiv(a, b, p = MOD):
        return modmul(a, modpow(b, p-2, p))

    """ initialize variables and set inputs
    
        
        
    
        
        
        
        
        
    
        
        
        
        
    
        
        
    """

    
    r = lambda: sys.stdin.readline().strip()
    r_int = lambda: int(r())
    R = lambda: list(map(int, r().split()))
    Rmap = lambda: map(int, r().split())
    Rfloat = lambda: list(map(float, r().split()))
    Rtuple = lambda: tuple(map(int, r().split()))

    """ how to treat input
    
    
    
    
    
    
    
    """

    if __name__ != '__main__':
        
        sys.stdin = open('sample.txt')

    
    

    S = int(r())
    if S == 10**18:
        print(*[0, 0, 0, 10**9, 10**9, 0])
    elif S >= 10**9:
        big = (S//(10**9)) * (10**9)
        big_a = S//(10**9) + 1 
        remain = 10**9 - (S%(10**9))
        print(*[0, 0, big_a, remain, 1, 10**9])
    else:
        print(*[0, 0, S, 0, 0, 1])
    
        
    
    
    
    
    

    """memo: how to use defaultdict of list
    
    Dic = defaultdict(list)
    
    Dic[x].append(y)
    
    for k, v in Dic.items():
    """

if __name__ == '__main__':
    main()

Solution (Python):
import math

S = int(input())

A = math.ceil(math.sqrt(S))

K = A ** 2 - S

print("0 0 {} {} {} {}".format(A, K, 1, A))

Solution (Python):
import math
S = int(input())
X1 = 0
Y1 = 0

X2 = math.ceil(S**0.5)
X3 = 1
Y3 = math.ceil(S**0.5)
Y2 = int((X2*Y3-S)/X3)

print("{} {} {} {} {} {}".format(X1,Y1,X2,Y2,X3,Y3))

Solution (Python):

from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007


def A():
    n = I()
    if n <= 1000000000:
        print(0,0,1,0,0,n)
    else:
        b = int(n**0.5)
        if b**2 == n:
            print(0,0,b,0,0,n//b)
            return
        b += 1
        x = b
        n = b*x-n
        for a in range(int(n**0.5)+1)[::-1]:
            if n%a == 0:
                print(0,0,x,n//a,a,b)
                return

    return


def B():
    n = I()

    return


def C():
    n = I()

    return


def D():
    n = I()

    return


def E():
    n = I()

    return


def F():
    n = I()

    return


if __name__ == "__main__":
    A()

Solution (Python):
from math import ceil

S = int(input())

tmp = ceil(pow(S,1/2))
near = pow(tmp,2)
delta = near - S
X1,Y1 = 0,0
X2,Y2 = 1,tmp
X3,Y3 = tmp,delta

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

def judge():
    return X3*Y2 - X2*Y3 == S

Solution (Python):
n = int(input())
r = int(n ** 0.5)
mx = 10 ** 9
if r * r - n < 0:
    r += 1
res = [0] * 6
res[2] = r
res[4] = 1
res[5] = r
while 1:
    d = res[2] * res[5] - n
    if d > mx or d < 0:
        if res[5] > 0:
            res[5] -= 1
        else:
            res[2] -= 1
        continue
    res[3] = d
    break


print(*res)

Solution (Python):

import sys
from operator import itemgetter
from fractions import gcd
from math import ceil, floor, sqrt
from copy import deepcopy
from collections import Counter, deque, defaultdict
import heapq
from functools import reduce
sys.setrecursionlimit(200000)
input = sys.stdin.readline
def ii(): return int(input())
def mi(): return map(int, input().rstrip().split())
def lmi(): return list(map(int, input().rstrip().split()))
def li(): return list(input().rstrip())
def debug(*args, sep=" ", end="\n"): print("debug:", *args, file=sys.stderr, sep=sep, end=end) if not __debug__ else None
def exit(*arg): print(*arg); sys.exit()


def divisor(n):
    ret = list()
    for i in range(1, int(sqrt(n)) + 1):
        if n % i == 0:
            ret.append(i)
            
    return sorted(ret)


def main():
    S = ii()
    X1, Y1 = 0, 0
    if (S <= 10 ** 9):
        print(0, 0, S, 0, 0, 1)
        sys.exit()
    for i in range(floor(sqrt(S)) - 3, floor(sqrt(S)) + 1000):
        if i * i >= S:
            if i * i == S:
                print(0, 0, i, 0, 0, i)
                sys.exit()
            if (i ** 2 - S) // divisor(i ** 2 - S)[-1] > 10**9:
                continue
            else:
                n = i
                break
    print(0, 0, n, divisor(n ** 2 - S)[-1], (n ** 2 - S) // divisor(n ** 2 - S)[-1], n)

if __name__ == '__main__':
    main()

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

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


x1 = 0
y1 = 0

INF = 10**9

q = int(math.sqrt(s))

if q*q<s:
    q=q+1
x2 = q
y3 = q

x3 = 1
y2 = x2*y3-s

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

Solution (Python):
import math
S = int(input())
q = math.ceil(S**(1/2))
b = q
c = q
a = q**2-S
d = 1
List = [a, b, c, d, 0, 0]
print(' '.join(list(map(str, List))))

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

x1 = 0
y1 = 0

x2 = math.ceil(math.sqrt(s))
y3 = math.ceil(math.sqrt(s))

x3 = 1
y2 = y3**2-s
assert (x2*y3-x3*y2)==s
assert x2<=10**9 and x3<=10**9 and y2<=10**9 and y3<=10**9
print(x1,y1,x2,y2,x3,y3)

Solution (Python):


from itertools import combinations
import math
import datetime
import sys


S = int(input())
x1 = x2 = y1 = y2 = 0

def print_ans_exit():
    print("0 0 {} {} {} {}".format(x1,y1,x2,y2))
    sys.exit()

square_ele = math.floor(math.sqrt(S))

if square_ele ** 2 == S:
    x1 = y2 = square_ele
    x2 = 0
    y1 = 1
    print_ans_exit()

if square_ele * (square_ele + 1) == S:
    x1 = square_ele
    y2 = square_ele + 1
    x2 = 0
    y1 = 1
    print_ans_exit()
if square_ele * (square_ele + 1) > S:
    x2y1 = square_ele * (square_ele + 1) - S
    x1 = square_ele
    y2 = square_ele + 1
    x2 = 1
    y1 = x2y1
    print_ans_exit()
else:
    x2y1 = (square_ele + 1) * (square_ele + 1) - S
    x1 = y2 = square_ele + 1
    x2 = 1
    y1 = x2y1
    print_ans_exit()

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

Solution (Python):
from math import sqrt, ceil, floor
S = int(input())
a = floor(sqrt(S))
d = a
while a*d < S:
    if d < 10**9:
        d += 1
    else:
        a+=1
b = a*d - S

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

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

Solution (Python):
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(input())
def inpl(): return list(map(int, input().split()))
def inpl_str(): return list(input().split())

S = inp()
if S == 10**18:
    print(0,0,10**9,0,10**9,10**9)
else:
    x2 = a = 10**9
    y3 = b = S//a + 1
    y2 = c = 1
    x3 = d = a*b-S
    x1 = y1 = 0
    print(x1,y1,x2,y2,x3,y3)

Solution (Python):
from sys import stdin, exit

S = int(stdin.readline().rstrip())
if S == 10 ** 18:
    print(0, 0, 10 ** 9, 0, 0, 10 ** 9)
    exit()
else:
    a = 10 ** 9
    b = 1
    c = 10 ** 9 - S % (10 ** 9)
    d = S // (10 ** 9) + 1
    print(0, 0, a, b, c, d)

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

Solution (Python):
S=int(input())
sqr=int(S**0.5)
if sqr==10**9:
    print(0,0,sqr,1,10**18-S,sqr)
    exit(0)
x1,y2=sqr+1,sqr+1
sub=(sqr+1)**2-S
print(0,0,x1,1,sub,y2)

Solution (Python):
a=int(input())
if a<10**9:
  print("0 0 0 "+str(a)+" 1 0")
else:
  if a%(10**9)!=0:
    b=10**9-a%(10**9)
    print("0 0 "+str((a+b)//(10**9))+" "+str(b)+" 1 "+str(10**9))
  else:
    print("0 0 "+str(a//(10**9))+" 0 0 "+str(10**9))

Solution (Python):
def main():
    s = int(input())
    m = 10 ** 9
    s1 = s // m
    s2 = s % m
    if s1 == m:
        print('0 0 {0} {1} {2} {3}'.format(m, 0, 0, m))
    else:
        print('0 0 {0} {1} {2} {3}'.format(m, 1, m - s2, s1 + 1))


main()

Solution (Python):

def solve():
    S = int(input())
    m = 10**9
    res = ' '.join(map(str, [0,0,((S-1)//m + 1), ((-S)%m), 1, m]))
    return res

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

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

N = int(input())

import math
BASE = math.ceil(math.sqrt(N))

X0=0
Y0=0

rest = BASE**2 - N

X1= BASE
Y2= BASE - rest//BASE

rest = X1*Y2 - N

if rest == 0:
    X2 = 0
    Y1 = 0

else:
    X2 = rest
    Y1 = 1

print(X0,Y0,X1,Y1,X2,Y2)

Solution (Python):
import math

s = int(input())
heiho = math.ceil(math.sqrt(s))

x1 = heiho
x2 = 1
y1 = heiho**2-s
y2 = heiho
x3 = 0
y3 = 0
l =map(str, [x1, y1, x2, y2, x3, y3])


print(" ".join(l))

Solution (Python):
s=int(input())
l=0
r=1000000000
while(r-l>1):
    c=(r+l)//2
    if c*c>s:
        r=c
    else:
        l=c
res=r*r-s
for i in range(1,100000):
    if res%i==0:
        if res//i<=1000000000:
            print(0,0,r,i,res//i,r)
            break

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

if s == 10**18:
    a = [0, 0]
    b = [0, 10**9]
    c = [10**9, 0]

    print(a[0], a[1], b[0], b[1], c[0], c[1])

    sys.exit()
a = [0, 0]

b = [0, 0]

c = [0, 0]

b[0] = int(s ** 0.5) + 1
c[1] = int(s ** 0.5) + 1

abouts = b[0] * c[1]

c[0] = 1
b[1] = abouts - s

print(a[0], a[1], b[0], b[1], c[0], c[1])

Solution (Python):
S = int(input())
s = S ** 0.5
if s == int(s):
    s = int(s)
else:
    s = int(s) + 1

a = s
d = s
b = 0
c = 0

diff = s ** 2 - S
q = int(diff ** 0.5) + 1
for i in range(1, q):
    if diff % i == 0 and diff // i <= 10**9:
        b = i
        c = diff // i
        break

print('{} {} {} {} {} {}'.format(0,0,a,b,c,d))

Solution (Python):
import sys
input = sys.stdin.readline
S = int(input())
stan=10**9
if S < stan:
	print("0 0 1 0 0 "+str(S))
elif S != 10**18:
	L = S//(stan)
	left = (L+1)*stan - S
	for i in range(1,stan):
		if left%i == 0 and left//i <= stan:
			ans1 = i
			ans2 = left//i
			break
	print("0 0 "+str(stan)+" "+str(ans1)+" "+str(ans2)+" "+str(L+1))
else:
	print("0 0 1000000000 0 1000000000 1000000000")

Solution (Python):
from math import ceil, sqrt
S = int(input())
x1, y1 = 0, 0
y2 = 0
x3 = 0
if S <= 10**9:
    x2, y2 = S, 0
    x3, y3 = 0, 1
else:
    sq_s = ceil(sqrt(S))
    x2, y2 = sq_s*sq_s - S, sq_s
    x3, y3 = sq_s, 1

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

Solution (Python):
import math
import os
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7

S = int(sys.stdin.readline())
a = math.ceil(math.sqrt(S))
x1 = a
y2 = math.ceil(S / a)
x2 = abs(x1 * y2 - S)
y1 = 1
print(x1, x2, y1, y2, 0, 0)

Solution (Python):
s = input()
l, r = 0, 10 ** 9
while l < r:
    m = (l + r) // 2
    if m ** 2 < s:
        l = m + 1
    else:
        r = m

bc = l ** 2 - s
print 0, 0, l, bc, 1, l

Solution (Python):
s = int(input())
a1 = int(s ** 0.5)
a2 = a1 + 1
if s - a1 ** 2 > a2 ** 2 - s:
    a = a2
    b = abs(s - a ** 2)
    print(0, end = " ")
    print(0, end = " ")
    print(a, end = " ")
    print(1, end = " ")
    print(b, end = " ")
    print(a)
elif s != 10 ** 18:
    a = a1
    b = abs(s - a ** 2)
    print(1, end = " ")
    print(0, end = " ")
    print(a + 1, end = " ")
    print(b, end = " ")
    print(0, end = " ")
    print(a)
else:
    print(0, end = " ")
    print(0, end = " ")
    print(10 ** 9, end = " ")
    print(0, end = " ")
    print(0, end = " ")
    print(10 ** 9)

Solution (Python):
s = int(input())
a = int(s**(1/2))
if s == a**2:
  b =0 
  print(" ".join(map(str, [0,0,a,1,b,a])))
elif a*(a+1) - s >= 0: 
  b = a*(a+1) - s
  print(" ".join(map(str, [0,0,a+1,1,b,a])))
else:
  b = (a+1)**2 - s
  print(" ".join(map(str, [0,0,a+1,1,b,a+1])))

Solution (Python):
from math import sqrt, ceil
S = int(input())
n = int(ceil(sqrt(S)))
X1 = Y1 = 0
if S > n*(n-1):
    X2 = Y3 = n
    X3 = 1
    Y2 = n*n - S
else:
    X2 = n
    Y3 = n - 1
    X3 = 1
    Y2 = n*(n-1) - S

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

Solution (Python):
s = int(input())
N = 10 ** 9
x2 = (s//N*N+N)-s
y1 = 1
x1 = N
y2 = (s + y1 * x2) // N
if s == N * N:
    x1 = N
    y1 = 0
    x2 = 0
    y2 = N
assert(abs(x1*y2-x2*y1)==s)
assert(0 <= x1 <= N)
assert(0 <= y1 <= N)
assert(0 <= x2 <= N)
assert(0 <= y2 <= N)
print(0, 0, x1, y1, x2, y2)

Solution (Python):



import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline 

s = int(input())


r = int(s**0.5)

res = r+5

for i in range(10,-10,-1):
    if r+i > 0 and (r+i)**2 >= s:
        res = r+i
    
if res*res-s <= 10**9:
    print(0,0,res,1,res*res-s,res)
else:
    print(0,0,res,1,res*(res-1)-s,res-1)

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

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

r = math.ceil(math.sqrt(s))
rem = r*r - s

x1, y1 = 0, 0
x2, y3 = r, r
x3, y2 = (0 if rem == 0 else 1), rem

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

Solution (Python):



def ri():
    return int(input())

def rl():
    return list(input().split())

def rli():
    return list(map(int, input().split()))

def area(x1, y1, x2, y2):
    return abs(x1*y2-x2*y1)

MOD = 10**9
def main():
    s = ri()
    if s % MOD == 0:
        x1 = s // MOD
        y1 = 0
    else:
        x1 = 1+s // MOD
        y1 = MOD - s % MOD
    y2 = MOD
    x2 = 1
    x3 = 0
    y3 = 0
    assert(x1 <= MOD)
    print(x1, y1, x2, y2, x3, y3)


if __name__ == '__main__':
    main()

Solution (Python):
import queue

"""
N = int(input())



A = []
for i in range(N):
	A.append(int(input()))

print(A)

"""
S = int(input())

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

print("0 0 1000000000 1",x2,int(y2))

Solution (Python):
def main():
    s = int(input())
    
    l = 0
    r = 10 ** 9
    while r - l != 1:
        m = l + r >> 1
        if m * m >= s:
            r = m
        else:
            l = m
    assert(r * r - s <= 10 ** 9)
    
    print(r, 1)
    print(r * r - s, r)
    print(0, 0)
    
    return 0

main()

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

nineth = 1000000000
x = nineth
y = s // nineth
a = 1
b = 0
amari = s % nineth
if amari != 0:
    y += 1
    b = nineth - amari
print('0', '0', x, a, b, y)

Solution (Python):
from math import ceil, sqrt
S = int(input())
a = d = ceil(sqrt(S))
b = a * d - S
c = 1
if max([a, b, c, d]) > 10e9:
    raise Exception()
print(0, 0, a, b, c, d)

Solution (Python):


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

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

mazu=[0,0]
heho=math.ceil(math.sqrt(s))

sa=heho**2-s
tugi=[heho,1]
san=[sa,heho]
subete=mazu+tugi+san
for sbt in subete:
    print(sbt, end=" ")

Solution (Python):
import math

S = int(input())

x3 = 0
y3 = 0
S_root = math.floor(S ** (1/2))
x1 = min(S_root + 1, 10 ** 9)
y2 = min(S_root + 1, 10 ** 9)
x2 = 1
y1 = (x1 * y2) - S

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

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

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

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

if n <= 10 ** 9:
    print(0, 0, n, 0, 0, 1)
elif n == 10 ** 18:
    print(0, 0, 10 ** 9, 0, 0, 10 ** 9)
else:
    rest = n % 10 ** 9
    c = 10 ** 9 - rest
    d = 1
    a = (n + 10 ** 9 - rest) // 10 ** 9
    b = 10 ** 9
    print(0, 0, a, c, d, b)

Solution (Python):
import math

n = list(map(int, input().split()))
n = n[0]

v1 = [0,0]

if(n<10**18):
    v2 = [1,0]
    v3 = [10**9,0]
    v2[1] = n//(10**9)+1
    a = n % (10**9)
    v3[1] = 10**9 - a
else:
    v2=[0,10**9]
    v3=[10**9,0]

print(v1[0],v1[1],v2[0],v2[1],v3[0],v3[1])

Solution (Python):
S = int(input())
M = 10**9
x = (S-1)//M + 1
y = -(S - x*M)

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

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

Solution (Python):
from sys import exit, setrecursionlimit, stdin, stderr
from functools import reduce
from itertools import *
from collections import *
from bisect import *
from heapq import *
import operator
import math
from fractions import gcd
from random import randint

setrecursionlimit(10**8)

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

def read():
  return int(input())
 
def reads():
  return [int(x) for x in input().split()]

S = read()
if S == 10**18:
  print(0, 0, 10**9, 0, 0, 10**9)
  exit()
  
y = (-S) % 10**9
z = 1
x = 10**9
assert (S + y) % 10**9 == 0
w = (S + y) // 10**9

print(0, 0, x, y, z, w)

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

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

Solution (Python):
S = int(input())
if S <= 10**9:
    print('0 0 1 0 0 {}'.format(S))
else:
    from math import ceil
    X2 = 10**9
    Y3 = ceil(S/X2)
    X3 = 1
    Y2 = 10**9*Y3-S
    print('0 0 {} {} {} {}'.format(X2,Y2,X3,Y3))

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

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

Solution (Python):
from math import sqrt
s = int(input())
a = 10**9
b = s // a
c = s % a
if(c != 0):
    b += 1
    c = a - c

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