#include <bits/stdc++.h>
using namespace std;
long long dp[10001];
const long long INF = 1e60 + 7;
long long binpow(long long a, long long b) {
  if (a == 0) {
    return 0;
  }
  if (b == 0) return 1;
  long long temp = binpow(a, b / 2);
  if (b & 1) {
    return temp * temp * a;
  } else
    return temp * temp;
}
long long poweroftwo(long long n) {
  if ((n && n & (n - 1)) == 0)
    cout << "y";
  else
    cout << "n";
}
long long binarysearch(long long a[], long long l, long long r, long long x) {
  while (l <= r) {
    long long mid = l + (r - l) / 2;
    if (a[mid] == x)
      return 1;
    else if (a[mid] > x) {
      r = mid - 1;
    } else {
      l = mid + 1;
    }
  }
  return 0;
}
long long findSplitPoint(long long arr[], long long n) {
  long long leftSum = 0;
  for (long long i = 0; i < n; i++) {
    leftSum += arr[i];
    long long rightSum = 0;
    for (long long j = i + 1; j < n; j++) rightSum += arr[j];
    if (leftSum == rightSum) return i + 1;
  }
  return -1;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  {
    long long n, m;
    cin >> n >> m;
    long long ans = 0;
    for (long long i = 0; i < n; i++) {
      long long x;
      cin >> x;
      ans = ans + x;
      cout << ans / m << " ";
      ans = ans % m;
    }
  }
}
