import std.stdio; import std.array; import std.conv; import std.algorithm; void main() { auto immutable input = readln().split; auto immutable N = input[0].to!int; auto immutable D = input[1].to!int; auto immutable A = readln().split.map!(v => v.to!int).array; auto result = [0]; auto prev_pos = 0; foreach (i; 1..N) { auto pos = A[i-1] + prev_pos; result ~= pos; prev_pos = pos; if (result[i] - result[i-1] < D) { result[i] = result[i-1] + D; } } writeln(result); }