#include <bits/stdc++.h>
using namespace std;
long long int factorial(long long int n) {
  if (n == 1)
    return 1;
  else
    return n * factorial(n - 1);
}
long long gcd(long long a, long long b) {
  long nod = 1L;
  long tmp;
  if (a == 0L) return b;
  if (b == 0L) return a;
  if (a == b) return a;
  if (a == 1L || b == 1L) return 1L;
  while (a != 0 && b != 0) {
    if (((a & 1L) | (b & 1L)) == 0L) {
      nod <<= 1L;
      a >>= 1L;
      b >>= 1L;
      continue;
    }
    if (((a & 1L) == 0L) && (b & 1L)) {
      a >>= 1L;
      continue;
    }
    if ((a & 1L) && ((b & 1L) == 0L)) {
      b >>= 1L;
      continue;
    }
    if (a > b) {
      tmp = a;
      a = b;
      b = tmp;
    }
    tmp = a;
    a = (b - a) >> 1L;
    b = tmp;
  }
  if (a == 0)
    return nod * b;
  else
    return nod * a;
}
long long int lcm(long long int a, long long int b) {
  return (a * b) / gcd(a, b);
}
int deg(long long int a, long long int n) {
  int i = 0;
  while (a > 0) {
    if (a % n == 0) {
      i++;
      a = a / n;
    } else if (a % n != 0)
      a = 0;
  }
  return i;
}
long long int voiz(long long int a, long long int b) {
  if (b > 0) {
    if (b % 2)
      return a * voiz(a, b - 1);
    else {
      long long int x = voiz(a, b / 2);
      return x * x;
    }
  } else
    return 1;
}
long long int voizmod(long long int a, long long int b, long long int mod) {
  if (b > 0)
    if (b % 2)
      return (a * voizmod(a, b - 1, mod));
    else {
      long long int x = voizmod(a, b / 2, mod);
      return ((x * x) % mod);
    }
  else
    return 1;
}
struct kek {
  int id;
  int A;
  int M;
};
bool cmp(const kek x, const kek y) {
  return x.M < y.M || x.M == y.M && x.A < y.A ||
         x.M == y.M && x.A == y.A && x.id < y.id;
}
bool PowerOfTwo(unsigned int x) { return ((x != 0) && ((x & (~x + 1)) == x)); }
bool isopen(char c) { return c == '(' || c == '{' || c == '['; }
bool ispair(char c1, char c2) { return c2 - c1 == 1 || c2 - c1 == 2; }
bool correct(const string &s) {
  stack<char> st;
  for (auto c : s) {
    if (isopen(c))
      st.push(c);
    else if (st.empty() || !ispair(st.top(), c))
      return 0;
    else
      st.pop();
  }
  return st.empty();
}
bool psp(string &s) {
  int k = 0;
  for (int i = 1; i < s.length() && k == 0; i++) {
    if (s[i - 1] == '(' && s[i] == ')' || s[i - 1] == '{' && s[i] == '}' ||
        s[i - 1] == '[' && s[i] == ']') {
      s.erase(i - 1, 2);
      k = 1;
    }
  }
  if (s.length() == 0)
    return 1;
  else if (k)
    return psp(s);
  else
    return 0;
}
long long int katalan(int n) {
  int A = 1;
  int B = 1;
  for (int i = 2; i < n + 1; i++) {
    A = B;
    B = 2 * (2 * i - 1) * A / (i + 1);
  }
  return B;
}
void gen(string &prefix, int op, int cl) {
  if (op == 0 && cl == 0)
    cout << prefix << endl;
  else {
    if (op > 0) {
      prefix.push_back('(');
      gen(prefix, op - 1, cl);
      prefix.pop_back();
    }
    if (cl > op) {
      prefix.push_back(')');
      gen(prefix, op, cl - 1);
      prefix.pop_back();
    }
  }
}
bool ispsp(string &s, int k) {
  int t = 0, r = 1;
  for (int i = 0; i < k; i++) {
    if (s[i] == '(')
      t++;
    else
      t--;
    if (t < 0) {
      r = 0;
      break;
    }
  }
  if (t != 0) r = 0;
  return r;
}
int main() {
  int n, m, r;
  cin >> n >> m;
  int a;
  int k = 0;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (a < (m - k))
      cout << 0 << " ";
    else {
      r = 1 + (a - (m - k)) / m;
      cout << r << " ";
    }
    k = (k + a) % m;
  }
}
