#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m, i, j, u, v, x;
  int a[200005];
  cin >> n >> m;
  for (i = 0; i < n; i++) cin >> a[i];
  x = 0;
  for (i = 0; i < n; i++) {
    u = a[i] / m;
    v = a[i] % m;
    x += v;
    if (x >= m) u++;
    x = x % m;
    cout << u << " ";
  }
  return 0;
}
