#include using namespace std; using ll = long long; constexpr char newl = '\n'; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int n, d; cin >> n >> d; int pos = 0; cout << 0; int sum = 0; for (int i = 1; i < n; i++) { int a; cin >> a; sum += a; pos = max(sum, pos + d); cout << " " << pos; } cout << newl; return 0; }