#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-6;
const int maxn = 1e9 + 7;
long long shu[200005];
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  while (cin >> n >> m) {
    for (int i = 1; i <= n; i++) {
      cin >> shu[i];
    }
    long long ans = 0;
    long long rev = 0;
    for (int i = 1; i <= n; i++) {
      rev += shu[i];
      ans = rev / m;
      rev %= m;
      cout << ans << " ";
    }
    cout << endl;
  }
  return 0;
}
