module Main where

import Control.Monad
import Control.Applicative
import Data.List

main = do
 n <- (read:: String -> Int) <$> getLine
 x <- map (read:: String -> Int) . words <$> getLine
 forM_ (reverse $ count n (x ++ [0])) print

count:: Int -> [Int] -> [Int]
count n x = let dist = fst $ foldl (\(line, former) x -> ((x - former):line, x)) ([], 0) x
                comp = sum $ map abs dist
            in do
                a <- [0..n-1]
                let del1 = dist !! a
                    del2 = dist !! (a + 1)
                return $ comp - abs del1 - abs del2 + abs (del1 + del2)
