#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 100;
void solve() {
  long long n, m, cur = 0;
  cin >> n >> m;
  vector<long long> a(n + 1, 0);
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    long long x = cur + a[i];
    cout << x / m << ' ';
    cur = x % m;
  }
  cout << '\n';
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
}
