#include <bits/stdc++.h>
using namespace std;
struct fenwick {
  int n;
  vector<long long> t;
  fenwick(int n = 0) : n(n) { t.assign(n, 0); }
  void incr(int i, long long delta) {
    for (; i < n; i |= (i + 1)) t[i] += delta;
  }
  long long sum(int r) {
    long long s = 0;
    for (; r >= 0; r = (r & (r + 1)) - 1) s += t[r];
    return s;
  }
  long long sum(int l, int r) { return sum(r) - sum(l - 1); }
};
long long n, p, t;
vector<long long> tt, res;
vector<pair<long long, long long> > ti;
set<long long> event;
set<int> wait;
queue<int> q;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> p;
  res.resize(n);
  tt.resize(n);
  for (int i = 0; i < n; ++i) {
    cin >> tt[i];
    event.insert(2 * tt[i] + 1);
  }
  fenwick f(n);
  ti.resize(n);
  for (int i = 0; i < n; ++i) ti[i] = make_pair(tt[i], i);
  sort(ti.begin(), ti.end());
  int pos = 0;
  int ind = -1;
  int num = 0;
  while (num < n) {
    t = *event.begin();
    event.erase(event.begin());
    if (t % 2 == 0) {
      f.incr(ind, -1);
      ind = -1;
    }
    t /= 2;
    while (pos < ti.size() && ti[pos].first == t) wait.insert(ti[pos++].second);
    if (!wait.empty()) {
      int ii = *wait.begin();
      if (f.sum(0, ii) == 0) {
        f.incr(ii, 1);
        q.push(ii);
        wait.erase(wait.begin());
      }
    }
    if (ind == -1 && !q.empty()) {
      ind = q.front();
      q.pop();
      res[ind] = t + p;
      ++num;
      event.insert(2 * res[ind]);
    }
  }
  for (int i = 0; i < n; ++i) cout << res[i] << " ";
  return 0;
}
