#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 10;
long long ans[MAXN], n, p, s[MAXN], k[MAXN];
priority_queue<long long> A;
priority_queue<pair<long long, long long> > B;
queue<long long> C;
int lowbit(int x) { return x & (-x); }
void add(int x, int op) {
  for (int i = x; i < MAXN; i += lowbit(i)) s[i] += op;
}
bool query(int x) {
  for (int i = x; i; i -= lowbit(i))
    if (s[i]) return true;
  return false;
}
inline long long read() {
  long long sss = 0, fff = 1;
  char ccc;
  ccc = getchar();
  while (ccc < '0' || ccc > '9') {
    if (ccc == '-') fff = -1;
    ccc = getchar();
  }
  while (ccc >= '0' && ccc <= '9')
    sss = (sss << 1) + (sss << 3) + (ccc ^ '0'), ccc = getchar();
  return sss * fff;
}
inline char R() {
  char ccc = getchar();
  while (ccc != '(' && ccc != ')') ccc = getchar();
  return ccc;
}
void check(long long x) {
  while (!B.empty() && (-B.top().first) <= x) A.push(-B.top().second), B.pop();
  while (true) {
    if (A.empty()) break;
    if (query(-A.top())) break;
    C.push(-A.top());
    add(-A.top(), 1);
    A.pop();
  }
}
void solve() {
  n = read();
  p = read();
  for (long long i = 1; i <= n; i++) {
    long long x = read();
    B.push(make_pair(-x, i));
  }
  long long now = 0;
  while (!(A.empty() && B.empty() && C.empty())) {
    check(now);
    if (C.empty() && A.empty()) {
      now = -B.top().first;
      check(now);
    }
    if (!C.empty()) {
      long long x = C.front();
      while (!B.empty() && (-B.top().first) <= now + p) check(-B.top().first);
      ans[x] = now + p;
      now += p;
      add(x, -1);
      C.pop();
    }
  }
  for (int i = 1; i <= n; i++) printf("%lld ", ans[i]);
}
int main() {
  int T = 1;
  while (T--) solve();
  return 0;
}
