#include <bits/stdc++.h>
using namespace std;
const int N = (int)2e5 + 5;
const int INF = (int)1e9 + 7;
int dx[8] = {1, 0, -1, 0, -1, -1, 1, 1};
int dy[8] = {0, 1, 0, -1, -1, 1, -1, 1};
int ini() {
  int x;
  scanf("%d", &x);
  return x;
}
long long inl() {
  long long x;
  scanf("%lld", &x);
  return x;
}
long long a[200009];
int main() {
  long long n, i, j, m;
  n = inl();
  m = inl();
  for (i = 1; i <= n; i++) {
    cin >> a[i];
  }
  long long s = 0;
  for (i = 1; i <= n; i++) {
    s += a[i];
    if (s >= m) {
      int r = s / m;
      s = s % m;
      cout << r << " ";
    } else {
      cout << 0 << " ";
    }
  }
  return 0;
}
