N,D = map(int, input().split()) A = [int(a) for a in input().split()] ans = [0] x = 0 for a in A: x += a if x-ans[-1] < D: ans.append(ans[-1]+D) continue ans.append(x) print(*ans)