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 g i j = abs @@ a_s.(i) - a_s.(j)
let f i = s - g (i - 1) i - g i (i + 1) + g (i - 1) (i + 1)
let _ = for i = 1 to n do Printf.printf "%d\n" @@ f i done