#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1e-9;
const int mod = 1e9 + 7;
const long long INF = 1e12 + 1;
const int N = 1e6 + 9;
int n, m;
int a[N];
long long ans[N], san;
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  for (int i = 1; i <= n; ++i) {
    san += a[i];
    if (san >= m)
      ans[i] = san / m, san -= (san / m) * m;
    else
      ans[i] = 0;
  }
  for (int i = 1; i <= n; ++i) {
    cout << ans[i] << " ";
  }
  exit(0);
}
