#include <bits/stdc++.h>
using namespace std;
bool cmp(int x, pair<int, int> p) { return (p.first > x) ? 1 : 0; }
int main() {
  int T, x, y, k;
  T = 1;
  for (int p = 0; p < T; p++) {
    int n, m;
    cin >> n >> m;
    int a[n + 1];
    int sum = 0;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
    }
    for (int i = 0; i < n; i++) {
      sum += a[i];
      int moves = sum / m;
      sum %= m;
      cout << moves << " ";
    }
  }
}
