lines = []
while line = gets
    lines << line.chomp.split(' ').map(&:to_i)
end

N = lines[0][0]

x1 = 0
for i in 1..N do
  x1 += lines[1][i-1] * ((-1) ** ((i+1) % 2))
end

ans = [x1]
for i in 2..N do
  ans[i-1] = 2 * lines[1][i-2] - ans[i-2]
end

for i in 1..N do
  print ans[i-1].to_s + " "
end