# coding: utf-8 # Your code here! s = int(input()) t = input().split(" ") u = int(input()) a = u % s b = u // s res = [0]*s res_t=[0]*s res[0]=int(t[0]) for x in range(b): for i in range(s): t_a = int(t[i]) t_b = int(t[(i+1)%s]) if t_a > t_b: if res[i]>=t_b: res[i]=res[i]-(t_b - res[(i+1)%s]) res[(i+1)%s]=t_b elif (res[i]+res[(i+1)%s]) >= t_b: res[i]=res[i]+res[(i+1)%s] - t_b res[(i+1)%s]=t_b else: res[(i+1)%s]=res[i]+res[(i+1)%s] res[i]=0 else: if t_b <= (res[i]+res[(i+1)%s]): res[i]=res[i]-(t_b - res[(i+1)%s]) res[(i+1)%s]=t_b else: res[(i+1)%s]=res[(i+1)%s]+res[i] res[i]=0 #print(res,res_t) if res_t == res: break res_t = res #print(res) if a !=0: for i in range(a): t_a = int(t[i]) t_b = int(t[(i+1)%s]) if t_a > t_b: if res[i]>=t_b: res[i]=res[i]-(t_b - res[(i+1)%s]) res[(i+1)%s]=t_b elif (res[i]+res[(i+1)%s]) >= t_b: res[i]=res[i]+res[(i+1)%s] - t_b res[(i+1)%s]=t_b else: res[(i+1)%s]=res[i]+res[(i+1)%s] res[i]=0 else: if t_b <= (res[i]+res[(i+1)%s]): res[i]=res[i]-(t_b - res[(i+1)%s]) res[(i+1)%s]=t_b else: res[(i+1)%s]=res[(i+1)%s]+res[i] res[i]=0 #print(res) print(*res)