#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("avx2")
#pragma GCC target(sse, sse2, sse3, ssse3, sse4, popcnt, tune = native)
using namespace std;
const long long inf = 1e17 + 47;
const long long MAXN = 1e5 + 47;
struct fenwik {
  vector<long long> ex;
  long long n;
  fenwik(long long p) {
    n = p;
    ex.resize(n, 0);
  }
  void change(long long p, long long add) {
    for (long long i = p; i < n; i = (i | (i + 1))) {
      ex[i] += add;
    }
  }
  long long get(long long r) {
    long long res = 0;
    for (long long i = r; i >= 0; i = (i & (i + 1)) - 1) res += ex[i];
    return res;
  }
  long long get(long long l, long long r) { return get(r) - get(l - 1); }
};
long long n, p;
fenwik Q(MAXN);
vector<pair<long long, long long> > event;
void read() {
  cin >> n >> p;
  event.resize(n);
  for (long long i = 0; i < n; i++) {
    cin >> event[i].first;
    event[i].second = i;
  }
  sort(event.begin(), event.end());
  reverse(event.begin(), event.end());
}
long long get_q(deque<pair<long long, long long> > &q) {
  if ((long long)(q.size()) == 0) return inf;
  return q.front().second;
}
long long get_p() {
  if ((long long)(event.size()) == 0) return inf;
  return event.back().first;
}
void solve() {
  deque<pair<long long, long long> > q;
  set<long long> one_step;
  vector<long long> ans(n, -1);
  while (true) {
    long long fq = get_q(q), fp = get_p();
    if (fq == fp && fq == inf) break;
    if (fp <= fq) {
      if (Q.get(event.back().second) == 0) {
        if ((long long)(q.size()) == 0)
          q.push_back({event.back().second, event.back().first + p});
        else
          q.push_back({event.back().second, q.back().second + p});
        Q.change(event.back().second, +1);
      } else {
        one_step.insert(event.back().second);
      }
      event.pop_back();
      continue;
    }
    long long p1 = q.front().first, tm = q.front().second;
    q.pop_front();
    ans[p1] = tm;
    Q.change(p1, -1);
    if ((long long)(one_step.size()) == 0) continue;
    long long step = *(one_step.begin());
    if (Q.get(step) == 0) {
      one_step.erase(one_step.begin());
      if ((long long)(q.size()) == 0)
        q.push_back({step, tm + p});
      else
        q.push_back({step, q.back().second + p});
      Q.change(step, +1);
    }
  }
  for (long long &p : ans) cout << p << " ";
  cout << "\n";
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long t = 1;
  while (t--) {
    read();
    solve();
  }
}
