#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long LL_INF = 0x3f3f3f3f3f3f3f3f;
const int maxn = 3e5 + 10;
const int mod = 1e9 + 7;
long long a[maxn];
int main() {
  long long n, m;
  scanf("%I64d%I64d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%I64d", &a[i]);
  }
  int now = 0;
  for (int i = 0; i < n; i++) {
    printf("%I64d%c", (a[i] + now) / m, " \n"[i == n - 1]);
    now = (a[i] + now) % m;
  }
}
