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