{-# LANGUAGE OverloadedLists     #-}
{-# LANGUAGE OverloadedStrings   #-}
{-# LANGUAGE ScopedTypeVariables #-}

import           Control.Monad
import           Data.IORef
import           Data.Maybe
import qualified Data.Text     as T
import qualified Data.Text.IO  as T
import           System.IO

import qualified Data.Vector   as V

readT :: Read a => T.Text -> a
readT = read . T.unpack

getLineSpcVec :: Read a => IO (V.Vector a)
getLineSpcVec = do
  t <- T.getLine
  let xs = V.fromList $ map readT $ T.split (== ' ') t
  return xs

main :: IO ()
main = travelingPlan

diffAbsV :: V.Vector Int -> Int -> Int -> Int
diffAbsV xs i j = let xi = xs V.! i
                      xj = xs V.! j
                 in  abs $ xi - xj

travelingPlan :: IO ()
travelingPlan = do
  n   :: Int   <- readLn
  as' :: V.Vector Int <- getLineSpcVec
  let as = 0 `V.cons` as' `V.snoc` 0
  print as
  sumDiff <- newIORef (0 :: Int)
  forM_ ([0..n] :: [Int]) $ \i ->
    modifyIORef sumDiff (+ diffAbsV as i (i + 1))
  sumDiff <- readIORef sumDiff
  forM_ ([1..n] :: [Int]) $ \i -> do
    ans <- newIORef 0
    modifyIORef ans (+ (sumDiff - diffAbsV as (i - 1) i - diffAbsV as i (i + 1) + diffAbsV as (i - 1) (i + 1)))
    print =<< readIORef ans