import qualified Data.ByteString.Char8 as BS
import Data.Char
import Data.List

toInts :: IO [Int]
toInts = unfoldr (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine

find_x_1 :: [Int] -> Int
find_x_1 ls =
  sum
    [ if even i
      then v
      else (-v)
    | (v, i) <- zip ls [0 ..]
    ]

solver :: [Int] -> Int -> [Int]
solver ls x_1 = x_1 : [(2 * a) - x | (a, x) <- zip ls $ solver ls x_1]

solver2 :: [Int] -> Int -> [Int]
solver2 ls x_1 = scanl (\x -> \a -> (a * 2) - x) x_1 ls

show_ans :: [Int] -> String
show_ans (x:[]) = []
show_ans (v:rest) = (show v) ++ " " ++ (show_ans rest)

main :: IO ()
main = do
  _ <- toInts
  dat <- toInts
  let x_1 = find_x_1 dat
  let ans = solver2 dat x_1
  putStrLn $ show_ans ans