#include <bits/stdc++.h>
long long a[300000], b[300000];
int main() {
  long long n, m, i, j, s;
  while (scanf("%I64d %I64d", &n, &m) == 2) {
    s = j = 0;
    for (i = 0; i < n; i++) {
      scanf("%I64d", &a[i]);
      s = s + a[i];
      if (i == 0)
        b[i] = a[i] / m;
      else
        b[i] = (s / m) - j;
      j = j + b[i];
      printf("%I64d ", b[i]);
    }
    printf("\n");
  }
  return 0;
}
