#include #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define all(x) (x).begin(),(x).end() #define rall(x) (x).rbegin(),(x).rend() #define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() ); using namespace std; using ll = long long; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } const ll INF = 1e9; const ll MOD = 1e9 + 7; int main(){ int n, d; cin >> n >> d; vector v(n); rep(i, n-1){ cin >> v[i+1]; v[i+1] += v[i]; } rep(i, n-1){ if(v[i+1] - v[i] <= d) v[i+1] = v[i] + d; } rep(i, n) cout << v[i] << " "; cout << endl; }