#include <bits/stdc++.h>
using namespace std;
const int mx = 1e5, mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n, m, temp;
  long long sum = 0;
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    cin >> temp;
    sum += temp;
    cout << sum / m << " ";
    sum %= m;
  }
  return 0;
}
