#include <bits/stdc++.h>
using namespace std;
long long n, m, sum, num, maxi = -10e9, maxn = -10e9, mini = 10e9, minn = 10e9,
                          a[200001], s[200001];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie();
  cout.tie();
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= n; i++) {
    sum += a[i];
    if (sum >= m) {
      s[i] = sum / m;
      sum = sum % m;
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << s[i] << " ";
  }
}
