# https://atcoder.jp/contests/abc133/tasks/abc133_d

n = gets.to_i
nums = gets.split.map(&:to_i)

sum = nums[0] * 2
res = Array.new(n - 1)

sign = -1
1.upto(n - 1) do |i|
  num = nums[i]
  sum += 2 * num * sign
  sign *= -1
end

res[0] = sum / 2

(n - 1).downto(1) do |i|
  next_i = i == n - 1 ? 0 : i + 1
  res[i] = 2 * nums[i] - res[next_i]
end

puts res.join(' ')