program abc133d
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int32):: n, i
    integer(int32), allocatable:: a(:), ans(:)

    read*, n
    allocate(a(n))
    allocate(ans(n))
    read*, a(:)

    ans(1) = (sum(a(1:n:2)) - sum(a(2:n:2)))
    ans(n) = 2*a(n) - ans(1)
    do i=n-1,2,-1
        ans(i) = 2*a(i) - ans(i+1)
    end do
    print'(*(i0,1x))', ans(:)
end program abc133d