#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void ZZ(const char* name, Arg1&& arg1) {
  cerr << name << " = " << arg1 << "\n";
}
template <typename Arg1, typename... Args>
void ZZ(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " = " << arg1;
  ZZ(comma, args...);
}
clock_t tim = clock();
struct node {
  long long l, tot;
  node(long long l_ = 0, long long tt = 0) { l = l_, tot = tt; }
};
struct segtree {
  long long N;
  vector<node> tree;
  segtree(long long n = 1e6) {
    N = n;
    n += 5;
    tree.resize(4 * n, node(0, 1));
  }
  node combine(node a, node b) {
    node c;
    c.tot = a.tot + b.tot;
    c.l = a.l;
    if (a.l == a.tot) c.l += b.l;
    return c;
  }
  void build(long long root, long long s, long long e) {
    if (s == e) {
      tree[root] = node(1, 1);
      return;
    }
    build(root * 2, s, (s + e) / 2);
    build(root * 2 + 1, (s + e) / 2 + 1, e);
    tree[root] = combine(tree[root * 2], tree[root * 2 + 1]);
  }
  void update(long long root, long long s, long long e, long long id,
              long long val) {
    if (id < s || id > e) return;
    if (s == e) {
      tree[root] = node(1, 1);
      return;
    }
    if (id <= (s + e) / 2)
      update(root * 2, s, (s + e) / 2, id, val);
    else
      update(root * 2 + 1, (s + e) / 2 + 1, e, id, val);
    tree[root] = combine(tree[root * 2], tree[root * 2 + 1]);
  }
  node query(long long root, long long s, long long e, long long l,
             long long r) {
    if (r < s || e < l) return node(0, 0);
    if (s >= l && r >= e) return tree[root];
    node a = query(root * 2, s, (s + e) / 2, l, r);
    node b = query(root * 2 + 1, (s + e) / 2 + 1, e, l, r);
    return combine(a, b);
  }
  void build() { build(1, 1, N); }
  void update(long long id, long long val) { update(1, 1, N, id, val); }
  node query(long long l, long long r) { return query(1, 1, N, l, r); }
};
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, x;
  cin >> n >> x;
  segtree s;
  for (long long i = (0); i < (n); i++) {
    long long k;
    cin >> k;
    long long aux = s.query(1, n + 5).l;
    if (k < aux) {
      long long diff = aux - k;
      diff += x - 1;
      diff /= x;
      k += diff * x;
    } else {
      long long diff = k - aux;
      diff /= x;
      k -= x * diff;
    }
    s.update(k + 1, 1);
    cout << s.query(1, n + 5).l << "\n";
  }
  cerr << "\nTime Taken : " << (long double)(clock() - tim) / CLOCKS_PER_SEC;
}
