#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long n, m, sum = 0;
  cin >> n >> m;
  vector<long long> ans(n);
  for (int i = 0; i < n; ++i) {
    long long a;
    cin >> a;
    sum += a;
    ans[i] = sum / m;
  }
  cout << ans[0];
  for (int i = 1; i < n; ++i) {
    cout << " " << ans[i] - ans[i - 1];
  }
  cout << endl;
}
