#include <bits/stdc++.h>
using namespace std;
int a[200005];
int t[200005];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  long long tmp = 0;
  for (int i = 1; i <= n; i++) {
    tmp += a[i];
    t[i] += tmp / m;
    tmp %= m;
  }
  for (int i = 1; i <= n; i++) cout << t[i] << " ";
  cout << endl;
  return 0;
}
