#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const long long inf = 1e18;
const int maxn = 11;
void solve() {
  int n, m, a;
  long long rst, remain;
  scanf("%d%d", &n, &m);
  remain = m;
  while (n--) {
    scanf("%d", &a);
    rst = 0;
    if (a >= remain) {
      rst = (a - remain) / m + 1;
      remain = m - (a - remain) % m;
    } else {
      remain -= a;
    }
    printf("%I64d ", rst);
  }
  return;
}
int main() {
  solve();
  return 0;
}
