n, d = [int(v) for v in input().split()] a = [0] b = [int(v) for v in input().split()] for i in range(n - 1): a.append(a[-1] + b[i]) for i in range(n - 1): k = a[i + 1] - a[i] if k < d: a[i + 1] = a[i] + d print(*a)