#include using namespace std; int main() { int n, d; cin >> n >> d; vector a(n); a[0] = 0; int pre = 0; for (int i = 1; i < n; ++i) { cin >> a[i]; a[i] += pre; pre = a[i]; } for (int i = 1; i < n; ++i) { int dist = a[i - 1] + d; if (a[i] < dist) { a[i] = dist; } } for (int i = 0; i < n; ++i) { cout << a[i]; if (i == n - 1) puts(""); else cout << " "; } return 0; }