#include #include #define rep(i, n) for(int i = 0; i < n; ++i) using namespace std; int main(){ int n, d; cin >> n >> d; vector a(n); a[0] = 0; int ai; rep(i, n - 1) { cin >> ai; a[i + 1] = a[i] + ai; } rep(i, n - 1) { a[i + 1] = max(a[i] + d, a[i + 1]); } rep(i, n) { cout << a[i] << (i != n - 1 ? ' ' : '\n'); } return 0; }