#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio;
  cin.tie(NULL);
  long long int n, m, curr = 0, temp;
  cin >> n >> m;
  while (n--) {
    cin >> temp;
    long long int pages = (curr + temp) / m;
    curr = (curr + temp) % m;
    cout << pages << " ";
  }
  return 0;
}
