from itertools import accumulate N, D, *A = map(int, open(0).read().split()) X = [0] + list(accumulate(A)) for i in range(N - 1): dx = X[i + 1] - X[i] if dx < D: X[i + 1] = X[i] + D print(*X)