#include using ll = long long; using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n,d; cin >> n >> d; int pa[n]{0}; int* p = &pa[0]; string s{ "0 " }; for (int i = 1; i < n; ++i) { cin >> *++p; if (*p - pa[i - 1] < d) *p = pa[i - 1] + d; s += to_string(*p) + " "; } printf("%s", s.c_str()); return 0; }