let () =
  let n = Scanf.scanf "%d\n" (fun n -> n) in
  let as_ = Array.init n (fun _ -> Scanf.scanf "%d " (fun a -> a)) in
  let s =
    Array.fold_left (fun (a, s) a' -> (a', abs (a - a') + s)) (0, 0) as_
    |> (fun (a, s) -> abs a + s) in
  let f i =
    if i = 0 || i = n + 1 then 0
    else as_.(i - 1) in
  for i = 1 to n do
    Printf.printf "%d\n" @@
      s + abs (f (i - 1) - f (i + 1))
      - abs (f (i - 1) - f i)
      - abs (f i - f (i + 1))
  done