require "matrix"

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

mat = Matrix.build(N, N) {|r, c|
  if r == c then
    1
  elsif r == c + 1 then
    1
  elsif r == 0 && c == (N - 1) then
    1
  else
    0
  end
}
a = Matrix[A]

(2 * a / mat).row(0).to_a.map{|r| printf("%d ", r.to_i)}
printf("\n")
