/** * @FileName a.cpp * @Author kanpurin * @Created 2020.06.26 00:01:57 **/ #include "bits/stdc++.h" using namespace std; typedef long long ll; int main() { int n,d;cin >> n >> d; vector a(n); a[0] = 0; for (int i = 0; i < n-1; i++) { int k;cin >> k; a[i + 1] = a[i] + k; } cout << a[0] << " "; for (int i = 0; i < n - 1; i++) { if (a[i + 1] < a[i] + d) { a[i + 1] = a[i] + d; } cout << a[i + 1] << " "; } cout << endl; return 0; }