There are n seats in the train's car and there is exactly one passenger occupying every seat. The seats are numbered from 1 to n from left to right. The trip is long, so each passenger will become hungry at some moment of time and will go to take boiled water for his noodles. The person at seat i (1 ≤ i ≤ n) will decide to go for boiled water at minute t_i.

Tank with a boiled water is located to the left of the 1-st seat. In case too many passengers will go for boiled water simultaneously, they will form a queue, since there can be only one passenger using the tank at each particular moment of time. Each passenger uses the tank for exactly p minutes. We assume that the time it takes passengers to go from their seat to the tank is negligibly small. 

Nobody likes to stand in a queue. So when the passenger occupying the i-th seat wants to go for a boiled water, he will first take a look on all seats from 1 to i - 1. In case at least one of those seats is empty, he assumes that those people are standing in a queue right now, so he would be better seating for the time being. However, at the very first moment he observes that all seats with numbers smaller than i are busy, he will go to the tank.

There is an unspoken rule, that in case at some moment several people can go to the tank, than only the leftmost of them (that is, seating on the seat with smallest number) will go to the tank, while all others will wait for the next moment.

Your goal is to find for each passenger, when he will receive the boiled water for his noodles.

Input

The first line contains integers n and p (1 ≤ n ≤ 100 000, 1 ≤ p ≤ 10^9) — the number of people and the amount of time one person uses the tank.

The second line contains n integers t_1, t_2, ..., t_n (0 ≤ t_i ≤ 10^9) — the moments when the corresponding passenger will go for the boiled water.

Output

Print n integers, where i-th of them is the time moment the passenger on i-th seat will receive his boiled water.

Example

Input


5 314
0 310 942 628 0


Output


314 628 1256 942 1570 

Note

Consider the example.

At the 0-th minute there were two passengers willing to go for a water, passenger 1 and 5, so the first passenger has gone first, and returned at the 314-th minute. At this moment the passenger 2 was already willing to go for the water, so the passenger 2 has gone next, and so on. In the end, 5-th passenger was last to receive the boiled water.
#include <bits/stdc++.h>
using namespace std;
class BinaryIndexedTree {
  int N;
  vector<int> tree;

 public:
  BinaryIndexedTree(int _N) : N(_N), tree(_N + 1) {}
  int query(int idx) {
    int res = 0;
    for (int i = idx; i > 0; i -= (i & -i)) res += tree[i];
    return res;
  }
  int query(int L, int R) { return L <= R ? query(R) - query(L - 1) : 0; }
  void update(int idx, int val = 1) {
    for (int i = idx; i <= N; i += (i & -i)) tree[i] += val;
  }
};
int N;
long long P;
int T[100004];
long long ans[100004];
struct Event {
  long long time;
  char type;
  int id;
  bool operator<(const Event& e) const {
    if (time != e.time) return time > e.time;
    if (type != e.type) return type < e.type;
    return id > e.id;
  }
};
int main(int argc, char* argv[]) {
  int N;
  long long P;
  scanf("%d %lld", &N, &P);
  for (int i = (1), _b = (N); i <= _b; ++i) scanf("%d", &T[i]);
  priority_queue<Event> eventQ;
  for (int i = (1), _b = (N); i <= _b; ++i) eventQ.push({T[i], 'W', i});
  int boiling = -1;
  queue<int> standing;
  priority_queue<int, vector<int>, greater<int> > sitting;
  BinaryIndexedTree empty_seats(N);
  for (int steps = 1; !eventQ.empty(); steps++) {
    Event e = eventQ.top();
    eventQ.pop();
    if (e.type == 'A') {
      if (boiling >= 0) {
        ans[boiling] = e.time;
        empty_seats.update(boiling, -1);
      } else {
      }
      if (!standing.empty()) {
        boiling = standing.front();
        standing.pop();
        eventQ.push({e.time + P, 'A', -1});
      } else
        boiling = -1;
    } else {
      sitting.push(e.id);
    }
    if (!sitting.empty()) {
      int id = sitting.top();
      if (empty_seats.query(id) == 0) {
        empty_seats.update(id, +1);
        sitting.pop();
        if (boiling < 0) {
          assert(standing.empty());
          boiling = id;
          eventQ.push({e.time + P, 'A', -1});
        } else {
          standing.push(e.id);
        }
      }
    }
  }
  for (int i = (1), _b = (N); i <= _b; ++i) printf("%lld ", ans[i]);
  putchar('\n');
  return 0;
}
