#include <bits/stdc++.h>
using namespace std;
int i, j, k, c = 0;
int main() {
  int t = 1;
  while (t) {
    int64_t n, m;
    cin >> n >> m;
    int done = 0;
    double mx = 0;
    int64_t a[n], b[n];
    for (int i = 0; i < n; i++) cin >> a[i];
    for (int i = 1; i < n; i++) a[i] = a[i] + a[i - 1];
    for (int i = 0; i < n; i++) a[i] = a[i] / m;
    b[0] = a[0];
    for (int i = 1; i < n; i++) b[i] = a[i] - a[i - 1];
    for (int i = 0; i < n; i++) cout << b[i] << " ";
    t--;
  }
  return 0;
}
