6
12 8 12 17 20 5
17 4 8 8 8 4
 6
4 1 12 9 3 11
12 20 19 12 19 11
 1
1
1
 2
1 2
1 1
 1
7
5
 6
16 20 18 7 14 2
17 12 4 10 7 4

705
 917
 1
 9
 5
 741

#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int main() {
  fast();
  long long o, l = 0, n, m;
  cin >> n >> m;
  for (long long i = 0; i < n; i++) {
    cin >> o;
    l += o;
    cout << (l / m) << " ";
    l = l % m;
  }
  return 0;
}
