n=int(input()) A=[None]+list(map(int,input().split())) B=[None]+[0]*n B[1]=A[1] x=int(input()) for t in range(1,x+1): a=1+(t-1)%n b=1+t%n div=A[b]-B[b] move=min(div,B[a]) B[a]-=move B[b]+=move print(*B[1:])