#include <bits/stdc++.h>
using namespace std;
struct Event {
  long long moment, type, id;
  bool operator<(const Event& autre) const {
    if (moment > autre.moment) return true;
    if (moment == autre.moment && type < autre.type) return true;
    if (moment == autre.moment && type == autre.type && id > autre.id)
      return true;
    return false;
  }
};
set<long long> debout;
deque<long long> dansFile;
set<long long> enAttente;
int32_t main() {
  long long N, P;
  cin >> N >> P;
  priority_queue<Event> events;
  for (long long i = 0; i < N; i++) {
    long long a;
    cin >> a;
    events.push({a, 1, i});
  }
  long long sol[N];
  for (long long i = 0; i < N; i++) sol[i] = -1;
  bool estEnTrain = false;
  while (!events.empty()) {
    Event actu = events.top();
    events.pop();
    if (actu.type == 0) {
      estEnTrain = false;
      debout.erase(actu.id);
      sol[actu.id] = actu.moment;
    } else {
      enAttente.insert(actu.id);
    }
    if (enAttente.size() &&
        (debout.empty() || *enAttente.begin() <= *debout.begin())) {
      dansFile.push_back(*enAttente.begin());
      debout.insert(*enAttente.begin());
      enAttente.erase(enAttente.begin());
    }
    if (!estEnTrain && dansFile.size() > 0) {
      estEnTrain = true;
      events.push({actu.moment + P, 0, dansFile.front()});
      dansFile.pop_front();
    }
  }
  for (long long i = 0; i < N; i++) {
    cout << sol[i] << " ";
  }
  cout << endl;
}
