N = gets.to_i
A = gets.split.map(&:to_i)

sum = 0
A.each_with_index do |a, i|
  if i.even?
    sum += a
  else
    sum -= a
  end
end

fa = sum

ans = [fa]

A[0..-2].each do |a|
  ans << 2 * a - ans.last
end

puts ans.join(' ')
