#include <bits/stdc++.h>
using namespace std;
long long int n, p;
long long int arr[1000000];
long long int answer[1000000];
queue<long long int> A;
set<long long int> C;
set<long long int> B;
priority_queue<pair<long long int, pair<long long int, long long int> > >
    events;
void update() {
  if (C.empty() && !B.empty()) {
    C.insert(*B.begin());
    A.push(*B.begin());
    B.erase(B.begin());
  }
  while (!B.empty() && *C.begin() > *B.begin()) {
    C.insert(*B.begin());
    A.push(*B.begin());
    B.erase(B.begin());
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> p;
  for (int i = 0; i < n; i++) cin >> arr[i];
  for (int i = 0; i < n; i++)
    events.push(pair<long long int, pair<long long int, long long int> >(
        -arr[i], pair<long long int, long long int>(1, -i)));
  long long int time = 0;
  while (!events.empty()) {
    pair<long long int, pair<long long int, long long int> > q = events.top();
    events.pop();
    q.first = -q.first;
    q.second.second = -q.second.second;
    time = q.first;
    if (q.second.first == 1) {
      if (A.size() == 0) {
        A.push(q.second.second);
        C.insert(q.second.second);
        events.push(pair<long long int, pair<long long int, long long int> >(
            -time - p,
            pair<long long int, long long int>(0, -q.second.second)));
      } else {
        B.insert(q.second.second);
        update();
      }
    } else {
      answer[q.second.second] = q.first;
      C.erase(A.front());
      A.pop();
      update();
      if (!A.empty()) {
        events.push(pair<long long int, pair<long long int, long long int> >(
            -time - p, pair<long long int, long long int>(0, -A.front())));
      }
    }
    update();
  }
  for (int i = 0; i < n; i++) cout << answer[i] << " ";
  cout << endl;
  return 0;
}
