let () =
    let main n =
        let s = n in
        let x1 = 0 in
        let y1 = 0 in
        let sq = int_of_float (ceil (sqrt (float (s)))) in
        let rec loop offs =
            let x2 = sq + offs in
            let y3 = sq - offs in
            let sq2 = x2 * y3 - s in
            if x2 > 1_000_000_000 || sq2 < 0 then failwith "??" else
                let rec loop_2 sq3 count =
                    if count > 1000000 || sq3 < 1 then loop (offs + 1) else
                    if sq2 mod sq3 = 0 then
                        let x3 = sq3 in
                        let y2 = sq2 / sq3 in
                        x1, y1, x2, y2, x3, y3
                    else loop_2 (sq3 - 1) (count + 1)
                in
                if sq2 = 0 then x1, y1, x2, 0, 0, y3 else
                let sq3 = int_of_float (floor (sqrt (float (sq2)))) in
                loop_2 sq3 0
        in
        loop 0
    in
    let x1, y1, x2, y2, x3, y3 = main (int_of_string (read_line ())) in
    Printf.printf "%d %d %d %d %d %d\n" x1 y1 x2 y2 x3 y3