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