#include using namespace std; int main() { int64_t n, d; cin >> n >> d; vector a(n); a[0] = 0; for (int64_t i = 1; i < n; i++) cin >> a[i]; vector ans = {0}; for (int64_t i = 1; i < n; i++) ans.emplace_back(ans.back() + a[i]); for (int64_t i = 1; i < n; i++) if (ans[i] - ans[i-1] < d) ans[i] = ans[i - 1] + d; for (const auto &p : ans) cout << p << (&p == &ans.back() ? '\n' : ' '); return 0; }