N = gets.to_i
A = Array.new(N + 1, 0)
gets.split.map(&:to_i).each_with_index{|a,i| A[i + 1] = a }

R = Array.new(N + 1, 0)
(2 .. N).each do |i|
  R[i] = A[i - 1] - R[i - 1]
end
r = (A[N] - R[N]) / 2
ans = (1 .. N).map do |i|
  if i.odd?
    (R[i] + r) * 2
  else
    (R[i] - r) * 2
  end
end
puts ans * ' '
