n,d=map(int,input().split()) A=[int(i) for i in input().split()] Ans=[0] for a in A: Ans.append(min(d,a)+A[-1]) print(*Ans)