#include <bits/stdc++.h>
using namespace std;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const int N = 3e5 + 20;
const long long mod = 1e9 + 7;
const bool debug = false;
template <class T>
inline void add(T &x, long long y) {
  x += y;
  if (x >= mod) x -= mod;
}
template <class T>
inline void del(T &x, long long y) {
  x -= y;
  if (x < 0) x += mod;
}
template <class T>
inline void add(T &x, long long y, long long z) {
  x = y + z;
  if (x >= mod) x -= mod;
}
inline long long qpow(long long x, long long y) {
  x %= mod;
  long long ret = 1;
  while (y) {
    if (y & 1) ret = ret * x % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return ret;
}
inline long long qmul(long long x, long long y, long long mod) {
  return ((x * y - (long long)((long double)x * y / mod) * mod) + mod) % mod;
}
inline long long gcd(long long x, long long y) { return x ? gcd(y % x, x) : y; }
inline long long lcm(long long x, long long y) { return x / gcd(x, y) * y; }
pair<int, int> node[N];
long long ans[N];
priority_queue<int, vector<int>, greater<int> > que;
queue<int> go;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) scanf("%d", &node[i].first), node[i].second = i;
  sort(node + 1, node + n + 1);
  long long now = 0;
  int l = 1, pre = n + 1;
  while (true) {
    while (l <= n && node[l].first <= now) {
      if (go.empty()) {
        if (node[l].second < pre)
          go.push(node[l++].second);
        else
          que.push(node[l++].second);
      } else if (go.back() > node[l].second) {
        go.push(node[l++].second);
      } else
        que.push(node[l++].second);
    }
    if (go.empty()) {
      if (que.empty()) {
        if (l > n) break;
        now = node[l].first;
        while (l <= n && node[l].first <= now) {
          if (go.empty() || go.back() > node[l].second) {
            go.push(node[l++].second);
          } else
            que.push(node[l++].second);
        }
      } else {
        go.push(que.top());
        que.pop();
      }
    }
    int id = go.front();
    go.pop();
    ans[id] = now;
    now += m;
    pre = id;
  }
  for (int i = 1; i <= n; ++i) printf("%lld%c", ans[i] + m, " \n"[i == n]);
  return 0;
}
