let rec lower_bound l r p =
  if r <= 1 + l
  then r
  else let m = (l + r) / 2 in
       if p m
       then lower_bound l m p
       else lower_bound m r p

let () = Scanf.scanf "%d" @@ fun s ->
  let x1 = lower_bound 0 s @@ fun x1 -> s <= x1 * x1 in
  Printf.printf "0 0 %d %d 1 %d" x1 (x1 * x1 - s) x1

