N, D = map(int, input().split()) A = list(map(int, input().split())) B = [0] for a in A: B += [B[-1] + a] for i in range(1, N): if B[i] - B[i-1] < D: B[i] = B[i-1] + D print(*B)