#include <bits/stdc++.h>
using namespace std;
const int maxd = 1e5 + 10;
int n, k;
priority_queue<int, vector<int>, greater<int> > sma;
queue<int> que;
vector<pair<int, int> > a;
long long ans[maxd];
int main() {
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    a.push_back(pair<int, int>(x, i));
  }
  sort(a.begin(), a.end());
  long long now = 0ll;
  int cnt = 0, idx = 0;
  while (cnt < n) {
    if (que.empty() && sma.empty()) now = a[idx].first;
    while (idx < n && a[idx].first <= now + k) {
      if (que.empty() || que.back() > a[idx].second)
        que.push(a[idx++].second);
      else
        sma.push(a[idx++].second);
    }
    now += k;
    ans[que.front()] = now;
    que.pop();
    cnt++;
    if (que.empty() && !sma.empty()) {
      que.push(sma.top());
      sma.pop();
    }
  }
  for (int i = 0; i < n; i++) printf("%lld ", ans[i]);
  return 0;
}
