#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1e5 + 10;
const long long MAX = 1000;
const long long inf = 0x3f3f3f3f;
const long long mod = 1e9 + 7;
long long n, m;
long long a[maxn];
pair<long long, long long> ini[maxn];
long long ans[maxn];
priority_queue<long long, vector<long long>, greater<long long> > wai;
queue<long long> q;
set<long long> s;
signed main() {
  std::ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n >> m;
  for (long long i = (1); i <= (n); ++i) {
    cin >> a[i];
    ini[i] = make_pair(a[i], i);
  }
  sort(ini + 1, ini + 1 + n);
  long long time = 0;
  long long pos = 1;
  while (1) {
    if (q.empty() && wai.empty()) {
      time = max(time, ini[pos].first);
    }
    while (pos <= n && ini[pos].first <= time + m) {
      if (q.empty() || *s.begin() > ini[pos].second) {
        q.push(ini[pos].second);
        s.insert(ini[pos].second);
      } else
        wai.push(ini[pos].second);
      pos++;
    }
    if (!q.empty()) {
      time += m;
      ans[q.front()] = time;
      s.erase(q.front());
      q.pop();
      if (pos == n + 1 && wai.empty() && q.empty()) break;
    }
    while ((!wai.empty()) && (q.empty() || *s.begin() > wai.top())) {
      q.push(wai.top());
      s.insert(wai.top());
      wai.pop();
    }
  }
  for (long long i = (1); i <= (n); ++i)
    cout << ans[i] << (i == n ? "\n" : " ");
}
