#include using namespace std; int main() { int N, D; cin >> N >> D; vector a( N - 1 ); for( int i = 0; i < N - 1; i++ ) { cin >> a[i]; } vector ans( N ); for( int i = 1; i < N; i++ ) { ans[i] = ans[i - 1] + a[i - 1]; } for( int i = 1; i < N; i++ ) { int d = ans[i] - ans[i - 1]; if( d < D ) ans[i] += D - d; } for( int i = 0; i < N; i++ ) { if( i ) cout << " "; cout << ans[i]; } cout << endl; }