def accumulate(a): n = len(a) ret = [0 for i in range(n + 1)] for i in range(1, n + 1): ret[i] = ret[i - 1] + a[i - 1] return ret N, D = map(int, input().split()) a = list(map(int, input().split())) positions = accumulate(a) for i in range(1, N): gap = positions[i] - positions[i - 1] if gap < D: positions[i] = positions[i - 1] + D print(*positions)