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>
const int N = 100054, M = N * 2;
int n, K, E = 0;
int a[N], b[N];
int to[M], first[N], next[M], deg[N];
int x[N * 4];
std::priority_queue<int> pq;
inline void up(int &x, const int y) { x < y ? x = y : 0; }
inline int min(const int x, const int y) { return x < y ? x : y; }
inline int max(const int x, const int y) { return x < y ? y : x; }
inline void addedge(int u, int v) {
  to[++E] = v, next[E] = first[u], first[u] = E, ++deg[v];
}
void adj(int id, int L, int R, int h, int v) {
  if (L == R) {
    x[id] = v;
    return;
  }
  int M = (L + R - 1) >> 1, lc = id << 1, rc = lc | 1;
  h <= M ? adj(lc, L, M, h, v) : adj(rc, M + 1, R, h, v);
  x[id] = max(x[lc], x[rc]);
}
int range(int id, int L, int R, int ql, int qr) {
  if (ql > qr) return 0;
  if (ql <= L && R <= qr) return x[id];
  int M = (L + R - 1) >> 1, lc = id << 1, rc = lc | 1, s = 0;
  if (ql <= M) up(s, range(lc, L, M, ql, qr));
  if (qr > M) up(s, range(rc, M + 1, R, ql, qr));
  return s;
}
int main() {
  int i, j, x, y;
  scanf("%d%d", &n, &K), --K;
  for (i = 1; i <= n; ++i) scanf("%d", a + i), b[a[i]] = i;
  for (i = 1; i <= n; ++i) {
    if (x = range(1, 1, n, max(b[i] - K, 1), b[i] - 1)) addedge(b[i], b[x]);
    if (x = range(1, 1, n, b[i] + 1, min(b[i] + K, n))) addedge(b[i], b[x]);
    adj(1, 1, n, b[i], i);
  }
  for (i = 1; i <= n; ++i)
    if (!deg[i]) pq.emplace(i);
  for (i = n; i; --i) {
    b[i] = x = pq.top(), pq.pop();
    for (j = first[x]; j; j = next[j])
      if (!--deg[y = to[j]]) pq.emplace(y);
  }
  for (i = 1; i <= n; ++i) a[b[i]] = i;
  for (i = 1; i <= n; ++i) printf("%d\n", a[i]);
  return 0;
}
