#include <bits/stdc++.h>
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using namespace std;
const int N = 1e5 + 4;
int n, p;
ll ans[N];
pair<int, int> a[N];
bool done[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n >> p;
  for (int i = (1); i <= (n); ++i) cin >> a[i].first, a[i].second = i;
  sort(a + 1, a + 1 + n);
  queue<int> q;
  priority_queue<int, vector<int>, greater<int> > pq, pq1;
  int ptr = 1;
  ll cur = -1;
  while (ptr <= n) {
    cur = a[ptr].first;
    while (ptr <= n && a[ptr].first <= cur) pq.push(a[ptr].second), ptr++;
    int mn = pq.top();
    q.push(mn);
    pq1.push(mn);
    pq.pop();
    while (!q.empty()) {
      int u = q.front();
      q.pop();
      cur += p;
      ans[u] = cur;
      done[u] = 1;
      int lst = -1, mn1 = N;
      vector<int> tem;
      while (ptr <= n && a[ptr].first <= cur) {
        if (lst == -1)
          lst = a[ptr].first, mn1 = a[ptr].second,
          tem = vector<int>(1, a[ptr].second);
        else {
          if (lst != a[ptr].first) {
            if (mn1 < mn) q.push(mn1), pq1.push(mn1), mn = mn1;
            for (int v : tem)
              if (v != mn1 || mn1 > mn) pq.push(v);
            tem = vector<int>(1, a[ptr].second);
            lst = a[ptr].first;
            mn1 = a[ptr].second;
          } else {
            tem.emplace_back(a[ptr].second);
            mn1 = min(mn1, a[ptr].second);
          }
        }
        ptr++;
      }
      if (mn1 < mn) q.push(mn1), pq1.push(mn1), mn = mn1;
      for (int v : tem)
        if (v != mn1 || mn1 > mn) pq.push(v);
      if (u == mn) {
        while (!pq1.empty() && done[pq1.top()]) pq1.pop();
        mn = (pq1.empty() ? N : pq1.top());
      }
      if (!pq.empty() && pq.top() < mn) {
        int tem = pq.top();
        pq.pop();
        q.push(tem);
        pq1.push(tem);
        mn = tem;
      }
    }
  }
  for (int i = (1); i <= (n); ++i) cout << ans[i] << ' ';
  return 0;
}
