import qualified Data.Text.Lazy as T
import qualified Data.Text.Lazy.IO as T
import qualified Data.Text.Lazy.Read as T
import qualified Data.Vector.Unboxed as VU
import Data.List (intercalate)

main :: IO ()
main = do
  n <- unsafeTextToInt <$> T.getLine :: IO Int
  as <- map unsafeTextToInt . T.words <$> T.getContents :: IO [Int]
  let
    as' = VU.fromList as :: VU.Vector Int
    x1 = VU.sum . VU.zipWith (*) (VU.iterateN n negate 1) $ as' :: Int
    xs = VU.prescanl subtract x1 . VU.map (2 *) $ as' :: VU.Vector Int
  putStrLn . intercalate " " . map show . VU.toList $ xs

unsafeTextToInt :: T.Text -> Int
unsafeTextToInt s = case T.signed T.decimal s of
  Right (n, _) -> n
{-# INLINE unsafeTextToInt #-}
