let split_string ?(pattern="") = Str.split @@ Str.regexp pattern
let n = Scanf.sscanf (read_line ()) "%d" @@ fun n -> n
let a = Array.of_list @@ [0] @ (read_line () |> split_string ~pattern:" " |> List.map int_of_string) @ [0]

let prices = Array.init (n + 1) (fun i -> abs (a.(i) - a.(i + 1)))
let sum = Array.fold_left (+) 0 prices

let () =
  for i = 1 to n do
    Printf.printf "%d\n" @@ sum - prices.(i - 1) - prices.(i) + abs (a.(i - 1) - a.(i + 1))
  done