#include using namespace std; int main() { int N, D, a, now = 0, sum = 0; cin >> N >> D; cout << now; while (cin >> a && (sum += a)) cout << " " << (sum >= now + D ? now = sum : now += D); cout << "\n"; }