#include <bits/stdc++.h>
using namespace std;
int n;
long long p, t;
struct person {
  int seat;
  long long time;
  person() {}
  person(int s, long long t) : seat(s), time(t) {}
};
bool operator<(const person& a, const person& b) {
  if (a.time != b.time) return (a.time < b.time);
  return (a.seat < b.seat);
}
int main() {
  cin >> n >> p;
  vector<long long> ans(n);
  set<person> sitting, sitting_ready, missing;
  queue<person> line;
  for (int i = 0; i < n; ++i) {
    cin >> t;
    sitting.insert(person(i, t));
  }
  long long T = 0;
  line.push(*sitting.begin());
  missing.insert(person(sitting.begin()->seat, 0));
  sitting.erase(sitting.begin());
  while (!sitting.empty() || !sitting_ready.empty() || !line.empty()) {
    if (line.empty()) {
      if (sitting_ready.empty()) {
        line.push(*sitting.begin());
        missing.insert(person(sitting.begin()->seat, 0));
        T = sitting.begin()->time;
        sitting.erase(sitting.begin());
      } else {
        line.push(person(sitting_ready.begin()->seat, T));
        missing.insert(*sitting_ready.begin());
        sitting_ready.erase(sitting.begin());
      }
    } else {
      long long endtime = line.front().time + p;
      while (!sitting.empty() && sitting.begin()->time < endtime) {
        if (missing.empty() || missing.begin()->seat > sitting.begin()->seat) {
          line.push(*sitting.begin());
          missing.insert(person(sitting.begin()->seat, 0));
        } else {
          sitting_ready.insert(person(sitting.begin()->seat, 0));
        }
        sitting.erase(sitting.begin());
      }
      T = endtime;
      missing.erase(person(line.front().seat, 0));
      ans[line.front().seat] = T;
      line.pop();
      if (!line.empty()) line.front().time = T;
      while (!sitting.empty() && sitting.begin()->time == T) {
        sitting_ready.insert(person(sitting.begin()->seat, 0));
        sitting.erase(sitting.begin());
      }
      if (!sitting_ready.empty() &&
          (missing.empty() ||
           missing.begin()->seat > sitting_ready.begin()->seat)) {
        line.push(person(sitting_ready.begin()->seat, T));
        missing.insert(*sitting_ready.begin());
        sitting_ready.erase(sitting_ready.begin());
      }
    }
  }
  for (long long res : ans) cout << res << " ";
  cout << endl;
  return 0;
}
