#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, sum = 0, b = 0, a, i, j;
  cin >> n >> m;
  long long int v[n];
  for (i = 0; i < n; i++) {
    cin >> v[i];
  }
  for (j = 0; j < n; j++) {
    sum = sum + v[j];
    a = sum / m - b;
    b = sum / m;
    cout << a << " ";
  }
  return (0);
}
