#include <bits/stdc++.h>
int main() {
  long long int n, m, result = 0, b;
  scanf("%I64d  %I64d ", &n, &m);
  long long int a[n];
  for (int i = 0; i < n; i++) {
    scanf("%I64d ", &a[i]);
  }
  for (int j = 0; j < n; j++) {
    result += a[j];
    b = floor(result / m);
    if (result >= m) {
      result %= m;
    }
    printf("%d ", b);
  }
  return 0;
}
