def rain_flows_into_dams(a)
  x1 = a.map.with_index do |v, i|
    sign = (i % 2 == 0 ? 1 : -1)
    sign * v
  end.inject(:+)

  ans = [x1]
  1.upto(a.size - 1) do |i|
    ans[i] = 2 * a[i - 1] - ans[i - 1]
  end
  puts ans.join("\s")
end

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