#include <bits/stdc++.h>
using namespace std;
struct Cmp {
  bool operator()(const long long& a, const long long& b) { return a > b; }
};
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  long long p;
  cin >> p;
  vector<long long> a(n);
  vector<long long> ans(n);
  for (int i = 0; i < (n); ++i) cin >> a[i];
  multiset<pair<long long, int>> ev1;
  multiset<long long> ev2;
  for (int i = 0; i < (n); ++i) ev1.insert(make_pair(a[i], i));
  ev2.insert(0);
  set<int, Cmp> free_pos;
  set<int> wait;
  queue<pair<int, long long>> q;
  while (ev1.size() || ev2.size()) {
    bool doEv1 =
        ev1.size() && (!ev2.size() || ev1.begin()->first <= *ev2.begin());
    bool doEv2 =
        ev2.size() && (!ev1.size() || *ev2.begin() <= ev1.begin()->first);
    bool doSkip = false;
    if (doEv2) {
      long long ctime = *ev2.begin();
      ev2.erase(ev2.begin());
      if (q.size()) {
        int id = q.front().first;
        long long time = q.front().second;
        q.pop();
        free_pos.erase(id);
        ans[id] = time;
        if (ev1.size() && ev1.begin()->first <= ctime &&
            free_pos.upper_bound(ev1.begin()->second) == free_pos.end() &&
            (!wait.size() || ev1.begin()->second < *wait.begin())) {
          doSkip = true;
          id = ev1.begin()->second;
          ev1.erase(ev1.begin());
          long long exitTime = ctime + p * (q.size() + 1);
          q.push(make_pair(id, exitTime));
          ev2.insert(exitTime);
          free_pos.insert(id);
        } else if (wait.size()) {
          int id = *wait.begin();
          if (free_pos.upper_bound(id) == free_pos.end()) {
            long long exitTime = ctime + p * (q.size() + 1);
            q.push(make_pair(id, exitTime));
            ev2.insert(exitTime);
            free_pos.insert(id);
            wait.erase(wait.begin());
          }
        }
      }
    }
    if (doEv1 && !doSkip) {
      long long ctime = ev1.begin()->first;
      int id = ev1.begin()->second;
      ev1.erase(ev1.begin());
      if (free_pos.upper_bound(id) == free_pos.end()) {
        long long exitTime = ctime + p;
        if (q.size()) exitTime = q.back().second + p;
        ev2.insert(exitTime);
        q.push(make_pair(id, exitTime));
        free_pos.insert(id);
      } else
        wait.insert(id);
    }
  }
  for (auto it : ans) cout << it << ' ';
  return 0;
}
