#include using namespace std; using ll = long long; template ostream& operator<<(ostream& os, const vector arr){ for(int i = 0; i < (int)arr.size(); i++)cout << arr[i] << (i == (int)arr.size() -1 ? "" : " "); return os;} int main() { int n, d; cin >> n >> d; vector a(n); for(int i = 1; i < n; i++) { int x; cin >> x; a[i] = a[i - 1] + x; } for(int i = 1; i < n; i++) { a[i] += max(0, d - (a[i] - a[i - 1])); } cout << a << endl; }