#include <bits/stdc++.h>
using namespace std;
int n, m;
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  long long last = 0, sum = 0;
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    sum += x;
    long long d = sum / m;
    cout << d - last << ' ';
    last = d;
  }
  return 0;
}
