#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e6;
long long a[MAX], b[MAX];
map<string, long long> m;
int main() {
  long long n, m, i, j;
  scanf("%lld%lld", &n, &m);
  for (i = 0; i < n; i++) scanf("%lld", &a[i]);
  long long p = 0;
  for (i = 0; i < n; i++) {
    long long x = a[i] / m;
    long long y = a[i] % m;
    if (p + y < m) {
      p = p + y;
      b[i] = x;
    } else {
      p = (p + y) % m;
      b[i] = x + 1;
    }
  }
  printf("%lld", b[0]);
  for (i = 1; i < n; i++) printf(" %lld", b[i]);
  return 0;
}
