#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  long long a[n];
  cin >> a[0];
  for (int i = 1; i < n; i++) {
    cin >> a[i];
    a[i] += a[i - 1];
  }
  cout << (a[0] / k) << " ";
  for (int i = 1; i < n; i++) {
    long long x = (a[i] / k) - (a[i - 1] / k);
    cout << x << " ";
  }
}
