{-# LANGUAGE OverloadedStrings #-}

import Control.Monad
import Control.Applicative
import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Map.Strict as M
import Data.List

main :: IO()
main = do
    _ <- getLine
    as <- map read . words <$> getLine
    mapM_ print $ solve as

solve :: [Int] -> [Int]
solve [] = []
solve ass = reverse $ foldl (\temp as' -> (getPrice as') : temp) [] (map (\k -> M.delete k assMap) $ [0..(length ass) - 1])
    where
        assMap = M.fromList $ zip [0..] (ass ++ [0])
        getPrice :: M.Map Int Int -> Int
        getPrice = snd . M.foldl (\(nowPos, price) nextPos -> (nextPos, price + abs (nowPos - nextPos))) (0, 0)