import Control.Applicative
import Data.List
import Data.Array

main = do
    n <- read <$> getLine
    a <- map read . words <$> getLine
    mapM_ print (solve n a)

solve :: Int -> [Int] -> [Int]
solve n a = map (calc arA arC s) [1..n]
    where s = sum cost
          arA = array (0,n+1) (zip [0..n+1] (0:(a ++ [0])))
          arC = array (0,n+1) (zip [0..n+1] cost)
          cost = 0:(zipWith (\x y -> abs (x-y)) a' (tail a'))
          a' = (0:a) ++ [0]

calc :: Array Int Int -> Array Int Int -> Int -> Int -> Int
calc arA arC s index = s - (arC ! index) - (arC ! (index+1)) + abs ((arA ! (index+1))- (arA ! (index-1)))
