#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a, last, cnt;
  scanf("%d %d", &n, &m);
  last = m;
  for (int i = 0; i < n; i++) {
    cnt = 0;
    scanf("%d", &a);
    if (a < last)
      last -= a;
    else {
      a -= last;
      cnt = a / m + 1;
      last = m - a % m;
    }
    printf("%d ", cnt);
  }
  return 0;
}
