#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0, flag = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    flag *= (ch == '-') ? -1 : 1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - 48;
    ch = getchar();
  }
  return x * flag;
}
void write(long long a) {
  if (a >= 10) write(a / 10);
  putchar(a % 10 + '0');
}
int n, m, a[200009], cnt;
int main() {
  n = read(), m = read();
  for (int i = (1), i_end_ = (n); i <= i_end_; ++i) a[i] = read();
  for (int i = (1), i_end_ = (n); i <= i_end_; ++i) {
    printf("%d ", a[i] / m + ((a[i] % m + cnt) >= m));
    cnt = (cnt + a[i] % m) % m;
  }
  return 0;
}
