main :: IO ()
main = do
  s <- getContents
  let nums1 = map read $ words s
  let (n:as) = nums1
  mapM_ (putStrLn . show) $ solve n (0:as++[0])
solve :: Int -> [Int] -> [Int]
solve n as = do
  i <- [1..n]
  return $ price $ splitAtx i as
 
splitAtx :: Int -> [a] -> [a]
splitAtx i xs = let
    (a, b) = splitAt i xs
   in
    a ++ (if null b then b else tail b)
  
price :: [Int] -> Int
price as = sum $ map abs $ zipWith (-) as (tail as)



  
  