#include <bits/stdc++.h>
using namespace std;
int main() {
  long long days, inday, pagemax, pages, totalnames = 0, totalpages = 0;
  cin >> days >> pagemax;
  long long npday[days], ppday[days];
  for (int a = 0; a < days; a++) {
    cin >> npday[a];
    totalnames += npday[a];
    inday = (totalnames / pagemax) - totalpages;
    totalpages += inday;
    ppday[a] = inday;
    cout << ppday[a] << " ";
  }
}
