#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long x, y, n, m, t, q, a, b, count = 0;
  cin >> n >> m;
  long long arr[n];
  for (x = 0; x < n; x++) cin >> arr[x];
  a = 0;
  for (x = 0; x < n; x++) {
    a = a + arr[x];
    cout << a / m << " ";
    a = a % m;
  }
}
