#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  long long ar[n + 3];
  for (int i = 0; i < n; i++) {
    cin >> ar[i];
  }
  long long cnt = 0, sum = 0;
  vector<long long> v;
  for (int i = 0; i < n; i++) {
    sum += ar[i];
    if (sum >= m) {
      cnt++;
      long long x = sum / m;
      sum -= (x * m);
      v.push_back(x);
    } else {
      v.push_back(0);
    }
  }
  for (int i = 0; i < v.size(); i++) {
    cout << v[i] << " ";
  }
  cout << "\n";
  return 0;
}
