#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, s = 0;
  cin >> n >> m;
  long long a[n + 110], b[n + 110];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    s += a[i];
    b[i] = s / m;
    s = s % m;
  }
  for (int j = 0; j < n; j++) {
    cout << b[j] << " ";
  }
  return 0;
}
