#include <bits/stdc++.h>
const int N = 100005;
int n, p, tmr[N], seq[N], que[N], fr = 1, tl = 0, T[N];
long long ans[N];
using namespace std;
priority_queue<int> Q;
int cmp(int a, int b) {
  if (tmr[a] == tmr[b]) return a < b;
  return tmr[a] < tmr[b];
}
int qry(int x) {
  int res = 0;
  while (x) res += T[x], x -= x & (-x);
  return res;
}
void ins(int x, int v) {
  while (x <= n) T[x] += v, x += x & (-x);
}
int main() {
  scanf("%d %d", &n, &p);
  for (int i = 1; i <= n; i++) scanf("%d", &tmr[i]), seq[i] = i;
  sort(seq + 1, seq + 1 + n, cmp);
  long long ntmr = 0;
  int pos = 1;
  while (pos <= n || !Q.empty() || fr <= tl) {
    if (fr <= tl) {
      while (pos <= n && ntmr + p > tmr[seq[pos]]) {
        if (!qry(seq[pos]))
          que[++tl] = seq[pos], ins(seq[pos], 1);
        else
          Q.push(-seq[pos]);
        pos++;
      }
      ntmr += p, ans[que[fr]] = ntmr, ins(que[fr], -1), fr++;
      while (pos <= n && ntmr == tmr[seq[pos]]) Q.push(-seq[pos]), pos++;
      if (!Q.empty()) {
        int now = -Q.top();
        if (!qry(now)) Q.pop(), que[++tl] = now, ins(now, 1);
      }
    } else {
      if (Q.empty() && ntmr < tmr[seq[pos]]) ntmr = tmr[seq[pos]];
      while (pos <= n && ntmr >= tmr[seq[pos]]) Q.push(-seq[pos]), pos++;
      int now = -Q.top();
      Q.pop(), que[++tl] = now, ins(now, 1);
    }
  }
  for (int i = 1; i <= n; i++) printf("%lld ", ans[i]);
  return 0;
}
