#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000000 + 5;
const int mod = 1000000007;
int main() {
  int n, m;
  cin >> n >> m;
  int a[n + 5];
  int sum = 0;
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    int t;
    int tmp;
    cin >> t;
    sum += t;
    cout << sum / m << " ";
    sum %= m;
  }
  return 0;
}
