#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, a, s = 0, nop = 0, i;
  cin >> n >> m;
  for (i = 0; i < n; i++) {
    cin >> a;
    s = s + a;
    nop = nop + (s / m);
    cout << (s / m) << " ";
    s = s % m;
  }
}
