#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
const int mod = 1e9 + 7;
const int N = 2e5 + 7;
const ll INF = 1e18;
const double PI = 3.1415926535897932384626;
void solve() {
  int n, m;
  cin >> n >> m;
  int r = 0;
  for (int i = 1; i <= n; ++i) {
    int a;
    cin >> a;
    r += a;
    cout << r / m << " ";
    r %= m;
  }
}
void fastIO(string name = "") {
  cin.tie(0)->sync_with_stdio(0);
  if (int((name).size())) {
    freopen((name + ".in").c_str(), "r", stdin);
    freopen((name + ".out").c_str(), "w", stdout);
  }
}
int main() {
  fastIO("");
  int tc = 1;
  while (tc--) solve();
  return 0;
}
