{-# OPTIONS_GHC -O2 -funbox-strict-fields #-}
import qualified Data.ByteString.Char8 as BC
import           Data.Maybe            (fromJust)
import qualified Data.Vector.Unboxed   as VU

main :: IO ()
main = do
  n <- readLn
  as <- getInts
  putStr . unlines . map show $ solve n as

solve :: Int -> [Int] -> [Int]
solve n as =  map skip [1 .. n] where
  va = VU.fromList  $ 0 : as ++ [0]
  d = sum $ zipWith cost [0 .. n + 1] [1 .. n + 1]
  skip i = d - cost (i - 1) i - cost i (i + 1) + cost (i - 1) (i + 1)
  cost i j = abs $ va `VU.unsafeIndex` i - va `VU.unsafeIndex` j

readInts :: BC.ByteString -> [Int]
readInts = map (fst . fromJust . BC.readInt) . BC.words

getInts :: IO [Int]
getInts = readInts <$> BC.getLine
