#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 100;
const double PI = 3.14159;
vector<int> v;
long long n, m, k, t, ans, sum, r, l, b, c, d, a;
bool f;
string s;
set<int> st;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    sum += x;
    ans += sum / m;
    sum %= m;
    cout << ans << " ";
    ans = 0;
  }
  return 0;
}
