You are given a permutation P_1 ... P_N of the set {1, 2, ..., N}.

You can apply the following operation to this permutation, any number of times (possibly zero):

* Choose two indices i,j (1 ≦ i < j ≦ N), such that j - i ≧ K and |P_i - P_j| = 1. Then, swap the values of P_i and P_j.



Among all permutations that can be obtained by applying this operation to the given permutation, find the lexicographically smallest one.

Constraints

* 2≦N≦500,000
* 1≦K≦N-1
* P is a permutation of the set {1, 2, ..., N}.

Input

The input is given from Standard Input in the following format:


N K
P_1 P_2 ... P_N


Output

Print the lexicographically smallest permutation that can be obtained.

Examples

Input

4 2
4 2 3 1


Output

2
1
4
3


Input

5 1
5 4 3 2 1


Output

1
2
3
4
5


Input

8 3
4 5 7 8 3 1 2 6


Output

1
2
6
7
5
3
4
8
#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 100, maxlog = 25;
const long long inf = 2e18, mod = 1e9 + 7;
int n, k, p[maxn], seg[4 * maxn], vertcnt, deg[maxlog * maxn], ans[maxn];
pair<int, int> sorted_p[maxn], seg_edge[maxlog * maxn];
vector<int> graph[maxn];
priority_queue<pair<int, int>, vector<pair<int, int> >,
               greater<pair<int, int> > >
    pq;
inline void handle(int a, int b) {
  if (seg_edge[a].first == -1)
    seg_edge[a].first = b;
  else
    seg_edge[a].second = b;
  deg[b]++;
}
void add(int u, int l, int r, int x, int val) {
  if (seg[u] != -1) handle(vertcnt, seg[u]);
  seg[u] = vertcnt++;
  if (r - l == 1) {
    handle(seg[u], val);
    return;
  }
  handle(seg[u], vertcnt);
  int mid = (l + r) / 2;
  if (x < mid)
    add(2 * u, l, mid, x, val);
  else
    add(2 * u + 1, mid, r, x, val);
}
void connect(int u, int l, int r, int b, int e, int vert) {
  if (seg[u] == -1) return;
  if (b <= l && r <= e) {
    graph[vert].push_back(seg[u]);
    deg[seg[u]]++;
    return;
  }
  int mid = (l + r) / 2;
  if (b < mid) connect(2 * u, l, mid, b, e, vert);
  if (r > mid) connect(2 * u + 1, mid, r, b, e, vert);
}
void dfs(int u) {
  if (u < n)
    for (int i : graph[u]) {
      deg[i]--;
      if (!deg[i]) {
        if (i < n)
          pq.push(make_pair(i, i));
        else
          dfs(i);
      }
    }
  else {
    int i = seg_edge[u].first;
    if (i != -1) {
      deg[i]--;
      if (!deg[i]) {
        if (i < n)
          pq.push(make_pair(i, i));
        else
          dfs(i);
      }
    }
    i = seg_edge[u].second;
    if (i != -1) {
      deg[i]--;
      if (!deg[i]) {
        if (i < n)
          pq.push(make_pair(i, i));
        else
          dfs(i);
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  for (int i = 0; i < 4 * maxn; i++) seg_edge[i] = make_pair(-1, -1);
  memset(seg, -1, sizeof(seg));
  cin >> n >> k;
  k--;
  for (int i = 0; i < n; i++) {
    cin >> p[i];
    p[i]--;
    sorted_p[i] = make_pair(p[i], i);
  }
  if (k == 0) {
    sort(p, p + n);
    for (int i = 0; i < n; i++) cout << p[i] + 1 << endl;
    return 0;
  }
  sort(sorted_p, sorted_p + n);
  vertcnt = n;
  for (int i = n - 1; i >= 0; i--) {
    int L = max(0, sorted_p[i].second - k),
        R = min(n, sorted_p[i].second + k + 1);
    connect(1, 0, n, L, R, sorted_p[i].second);
    add(1, 0, n, sorted_p[i].second, sorted_p[i].second);
  }
  for (int i = 0; i < vertcnt; i++)
    if (!deg[i]) {
      if (i < n)
        pq.push(make_pair(i, i));
      else
        pq.push(make_pair(-1, i));
    }
  int ind = 0;
  while (!pq.empty()) {
    int now = pq.top().second;
    if (now < n) ans[ind++] = now + 1;
    pq.pop();
    dfs(now);
  }
  for (int i = 0; i < n; i++) cout << ans[i] << endl;
}
