#include <bits/stdc++.h>
using namespace std;
long long pw_mod(long long base, long long p) {
  if (!p) return 1;
  long long x, t, temp = 1;
  while (p > 1) {
    if (p & 1) {
      (temp *= base) %= (long long)(1e9 + 7);
      p--;
    }
    (base *= base) %= (long long)(1e9 + 7);
    p /= 2;
  }
  return (base * temp) % (long long)(1e9 + 7);
}
long long pw(long long base, long long p) {
  if (!p) return 1;
  long long x, t, temp = 1;
  while (p > 1) {
    if (p & 1) {
      (temp *= base);
      p--;
    }
    (base *= base);
    p /= 2;
  }
  return (base * temp);
}
long long arr[200005], sum, ans[200005];
int main() {
  long long n, m;
  cin >> n >> m;
  for (int i = 0; i <= n - 1; ++i) cin >> arr[i];
  for (int i = 0; i <= n - 1; ++i) {
    sum += arr[i];
    ans[i] = sum / m;
    sum %= m;
  }
  for (int i = 0; i <= n - 1; ++i) cout << ans[i] << " ";
  return 0;
}
