#include <bits/stdc++.h>
using namespace std;
int n, m, now, ans[200010], x;
int main() {
  now = 0;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%d", &x);
    ans[i] = 0;
    now += x;
    ans[i] = now / m;
    now -= (ans[i] * m);
  }
  for (int i = 0; i < n; i++) {
    if (i != 0) printf(" ");
    printf("%d", ans[i]);
  }
  printf("\n");
  return 0;
}
