#include <bits/stdc++.h>
using namespace std;
const int INF = 987654321;
const int MOD = 1000000007;
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  int arr[200001] = {};
  for (int i = 0; i < n; i++) {
    scanf("%d", arr + i);
  }
  int val = 0;
  for (int i = 0; i < n; i++) {
    val += arr[i];
    printf("%d ", val / m);
    if (val / m) val -= m * (val / m);
  }
}
