#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n, q;
  cin >> q >> n;
  int carry = 0;
  while (q--) {
    int k;
    cin >> k;
    k += carry;
    cout << k / n << ' ';
    carry = k % n;
  }
}
