#include <bits/stdc++.h>
int main() {
  long long int s = 0, T = 0, t = 0, n = 0, m = 0, i = 0, *a;
  scanf("%lld %lld", &n, &m);
  a = (long long int *)malloc(sizeof(long long int) * n);
  for (i = 0; i < n; i++) scanf("%lld", &a[i]);
  for (i = 0; i < n; i++) {
    s += a[i];
    t = s / m;
    printf("%lld ", t - T);
    T = t;
  }
  free(a);
  return 0;
}
