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;
priority_queue<int, vector<int>, greater<int> > Q;
const int N = 500005;
int a[N], val[N << 2];
inline int query(int root, int l, int r, int L, int R) {
  if (r < L || l > R) return 0;
  if (L <= l && r <= R) return val[root];
  return max(query(root << 1, l, ((l + r) >> 1), L, R),
             query((root << 1) | 1, ((l + r) >> 1) + 1, r, L, R));
}
inline void update(int root, int l, int r, int x, int y) {
  if (l == r) {
    val[root] = y;
    return;
  }
  if (x <= ((l + r) >> 1))
    update(root << 1, l, ((l + r) >> 1), x, y);
  else
    update((root << 1) | 1, ((l + r) >> 1) + 1, r, x, y);
  val[root] = max(val[root << 1], val[(root << 1) | 1]);
}
int Head[N], Next[N << 1], Adj[N << 1], tot = 0, d[N], ans[N];
inline void addedge(int u, int v) {
  Next[++tot] = Head[u], Head[u] = tot, Adj[tot] = v, d[v]++;
}
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  for (int i = 1, x; i <= n; i++) scanf("%d", &x), a[x] = i;
  for (int i = 1; i <= n; i++) {
    int t = query(1, 1, n, max(1, a[i] - k + 1), a[i]);
    if (t) addedge(a[k], a[i]);
    t = query(1, 1, n, a[i], min(n, a[i] + k - 1));
    if (t) addedge(a[k], a[i]);
    update(1, 1, n, a[i], i);
  }
  for (int i = 1; i <= n; i++)
    if (!d[i]) Q.push(i);
  int Time = 0;
  while (!Q.empty()) {
    int x = Q.top();
    ans[x] = ++Time;
    Q.pop();
    for (int e = Head[x]; e; e = Next[e]) {
      d[Adj[e]]--;
      if (!d[Adj[e]]) Q.push(Adj[e]);
    }
  }
  for (int i = 1; i <= n; i++) printf("%d\n", ans[i]);
  return 0;
}
