require "matrix"
n = gets.chomp.to_i
double_dam_ary = gets.chomp.split().map{|i| i.to_i*2}

matrix = n.times.map {|i|
  tmp_row = Array.new(n,0)
  if i == n-1
    tmp_row[i] = 1
    tmp_row[0] = 1
  else
    tmp_row[i..i+1] = [1,1]    
  end
  tmp_row
}
matrix = Matrix.rows(matrix)
dam_vec = Vector.elements(double_dam_ary)

ans = matrix.inv*dam_vec.to_a.map(&:to_i)
puts ans