main = do
  n <- readLn :: IO Int
  as <- getLine >>= return . map read . words :: IO [Int]

  let
    f (_:[]) = 0
    f (x:y:xs) = (abs (y-x)) + (f (y:xs))
    s = f (0 : as ++ [0])
    g (_:_:[]) = []
    g (x:y:z:xs) = (abs (x-z) - abs (x-y) - abs (y-z)) : (g (y:z:xs))

  mapM_ print $ map (s +) (g (0 : as ++ [0]))