N,D=map(int,input().split()) a=[0]+list(map(int,input().split())) x=[sum(a[:i+1]) for i in range(N)] print("0",end="") #0番 for i in range(1,N): x[i]=max(x[i-1]+D,x[i]) print(" "+str(x[i]),end="") #1~N-1番 print("")