n, d = map(int, input().split()) A = list(map(int, input().split())) X = [0]*n for i in range(1, n): X[i] = X[i-1]+A[i-1] ans = [] for i in range(n): if i == 0: ans.append(X[i]) else: if X[i]-X[i-1] >= d: ans.append(X[i]) else: X[i] += d-X[i]+X[i-1] ans.append(X[i]) print(*ans)