manip list x  = take x list ++ drop (x+1) list ++[0]

main = do
    n <- readLn
    a <- map read . words <$> getLine
    mapM print $ map snd $map (foldl (\(pre,mov)-> \new->(new,mov+abs (new-pre))) (0,0)) $map (manip a) [0..n-1]