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

b = []
b[0] = 0
1.upto(n) do |i|
  b[i] = 2 * (a[i-1] - b[i-1]/2)
end

b[0] = (b[0] + b[n])/2
1.upto(n) do |i|
  b[i] = 2 * (a[i-1] - b[i-1]/2)
end

if b[0] == b[n]
  puts b[0..-2]*" "
  exit 0
end
