program main
  implicit none
  integer(8) i,N,n_min,j,t1
  integer(8),allocatable :: A(:)
  integer(8),allocatable :: rain(:)
  integer(8),allocatable :: V(:,:)
  read(*, *) N
  allocate(A(N))
  allocate(rain(N))
  allocate(V(N,N))
  read(*, *) (A(i), i = 1,N)
  V = 1
  do i = 1,N
    do j = 1,(N-1)/2
      if (i+2*j-1>N) then
        t1 = mod(i+2*j-1,N)
      else 
        t1 = i+2*j-1
      end if
      V(i,t1) = -1
    end do
  end do
  rain = 0
  do i = 1,N
    do j = 1,N
      rain(i) = rain(i) + A(j)*V(i,j)
    end do
  end do
  write(*,*) rain
end program main
