#include <bits/stdc++.h>
using namespace std;
long long max(long long a, long long b) { return a > b ? a : b; }
long long min(long long a, long long b) { return a < b ? a : b; }
long long a[200010], b[200010];
int main() {
  long long m, n;
  while (cin >> n >> m) {
    long long sum1 = 0, sum2 = 0;
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
    }
    b[0] = a[0] / m;
    sum1 = b[0];
    sum2 = a[0];
    for (long long i = 1; i < n; i++) {
      sum2 += a[i];
      b[i] = sum2 / m - sum1;
      sum1 += b[i];
    }
    cout << b[0];
    for (long long i = 1; i < n; i++) {
      cout << " " << b[i];
    }
    cout << endl;
  }
  return 0;
}
