#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> num(n);
  for (long long i = 0; i < n; i++) cin >> num[i];
  long long more = m;
  for (long long i = 0; i < n; i++) {
    if (more > num[i]) {
      cout << "0 ";
      more -= num[i];
    } else {
      if ((num[i] - more) % m == 0) {
        cout << (num[i] - more) / m + 1 << " ";
        more = m;
      } else {
        num[i] -= more;
        cout << num[i] / m + 1 << " ";
        more = m - (num[i] % m);
      }
    }
  }
  return 0;
}
