#include <bits/stdc++.h>
using namespace std;
int t[2000000 + 5], n, p;
bool vis[2000000 + 5];
long long ans[2000000 + 5];
priority_queue<pair<long long, int> > Q1;
priority_queue<int> Q2;
priority_queue<int> Q;
queue<int> q;
const int inf = 1e9;
int getMin() {
  while (!Q.empty() && vis[-Q.top()]) Q.pop();
  return Q.empty() ? inf : -Q.top();
}
int main(int argc, char const *argv[]) {
  scanf("%d%d", &n, &p);
  for (int i = 1; i <= n; i++) {
    scanf("%d", t + i);
    Q1.push(make_pair(-t[i], inf - i));
  }
  int flag = 0;
  while (!Q1.empty()) {
    int u = Q1.top().second;
    if (u > n)
      u = inf - u;
    else
      u = -u;
    long long tm = -Q1.top().first;
    Q1.pop();
    if (u > 0)
      Q2.push(-u);
    else {
      ans[-u] = tm;
      flag = 0;
    }
    while (!Q2.empty()) {
      if (getMin() < -Q2.top() || flag && flag < -Q2.top()) break;
      int v = -Q2.top();
      Q2.pop();
      q.push(v), Q.push(-v);
    }
    if (!flag && !q.empty()) {
      int v = q.front();
      q.pop();
      vis[v] = 1, flag = v;
      Q1.push(make_pair(-tm - p, v));
    }
  }
  for (int i = 1; i <= n; i++) printf("%lld ", ans[i]);
  puts("");
  return 0;
}
