#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 10;
int gcd(int a, int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
bool prime[10000];
void sieve() {
  for (int p = 2; p * p <= 10000; p++) {
    if (prime[p] == true) {
      for (int i = p * p; i <= 10000; i += p) prime[i] = false;
    }
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  int a[n + 5];
  for (int i = 0; i < n; i++) cin >> a[i];
  int ans = 0, k = 0;
  for (int i = 0; i < n; i++) {
    a[i] = a[i] + k;
    ans = a[i] / m;
    k = a[i] % m;
    cout << ans << ' ';
  }
}
