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 in Python (3.4.3) (judge verdict: Runtime Error)


"""Triangle Program
"""

import sys
import itertools

def calc_right_tri(p1, p2):
    """Calcrate right triangle area method
    """
    x = abs(p1[0] - p2[0]) 
    y = abs(p1[1] - p2[1])
    return x * y /2 

def calc_square(p_list):
    """Calcrate square area method
    """
    x_list = []
    y_list = []
    for x, y in p_list:
        x_list.append(x)
        y_list.append(y)
    return (max(x_list) - min(x_list)) * (max(y_list) - min(y_list))

def calc_tri(p_list):
    """Calcrate triangle area method
    """
    # 3点の組み合わせリスト
    p_comb = list(itertools.combinations(p_list, 2))

    # 三角形の入る正方形の面積
    area = calc_square(p_list)

    # 3つの直角三角形の面積を正方形の面積から引く
    for p in p_comb:
       area = area - (calc_right_tri(p[0], p[1]))

    return area

def print_points(p_list):
    """Print three points method
    """
    space = ''
    for p in p_list:
        print("{0}{1} {2}".format(space, *p), end="")
        space = ' '
    print('\n', end="")
     

if __name__ == "__main__":
    args = sys.argv
    area = int(args[1])

    # 3点の組み合わせを作成
    all_p = list(itertools.combinations(range(1, 30), 2))
    p_comb_list = list(itertools.combinations(all_p, 3))

    for p_list in p_comb_list:
        if calc_tri(p_list) == (area / 2):
            print_points(p_list)
            sys.exit()