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

a_sum_half = A.inject(:+) / 2
other_sum = 0
1.step(N - 1, 2){|i| other_sum += A[i]}

mnt_h = a_sum_half - other_sum
A.each_with_index{|a, idx|
  printf("#{mnt_h * 2} ")
  mnt_h = a - mnt_h if idx < N - 1
  mnt_h = A[0] - mnt_h if idx == N - 1
}
printf("\n")
