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