#include <bits/stdc++.h>
using namespace std;
const int inf = (1 << 30) - 1;
const int maxn = 200010;
int IN() {
  int c, f, x;
  while (!isdigit(c = getchar()) && c != '-')
    ;
  c == '-' ? (f = 1, x = 0) : (f = 0, x = c - '0');
  while (isdigit(c = getchar())) x = (x << 1) + (x << 3) + c - '0';
  return !f ? x : -x;
}
int n, m, T;
long long a[maxn];
int main() {
  while (~scanf("%d%d", &n, &m)) {
    long long sum = 0;
    a[0] = 0;
    for (int i = 1; i <= n; i++) {
      long long x;
      scanf("%lld", &x);
      sum += x;
      a[i] = (sum / m);
    }
    for (int i = 1; i < n; i++) printf("%lld ", a[i] - a[i - 1]);
    printf("%lld\n", a[n] - a[n - 1]);
  }
  return 0;
}
