module Main where
import qualified Control.Monad as C
import qualified Data.Char as C
import qualified Data.List as L
import qualified Data.Map as M
import qualified Data.Array as A

int = read :: String -> Int
getWord :: IO String
getWord = do
  c <- getChar
  if C.isSpace c
  then
    return []
  else do
    ws <- getWord
    return (c:ws)
getInt = fmap int getWord
replace pred a = map (\x -> if pred x then a else x)

main = interact $ printer . solver . parser
parser = map int . tail . words
printer = unlines . map show

solver as = ans
  where
    asz = [0] ++ as ++ [0]
    df1 = zipWith (\x y -> abs(x-y)) asz $ tail asz
    df2 = zipWith (\x y -> abs(x-y)) asz $ tail(tail asz)
    sm = sum df1
    pl = zipWith (+) df1 $ tail df1
    sb = zipWith (-) df2 pl
    ans = map (sm+) sb
