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>
inline int min(int x, int y) { return x < y ? x : y; }
inline int max(int x, int y) { return x < y ? y : x; }
char G[3500000], *H = G;
inline int read() {
  int x = 0;
  while (*H < 48 || 57 < *H) H++;
  while (47 < *H && *H < 58) x = (x << 1) + (x << 3) + (*H++ ^ 48);
  return x;
}
int S[6], T;
inline void print(int x) {
  int y;
  do y = x / 10, S[T++] = x - y * 10, x = y;
  while (x);
  while (T) *H++ = S[--T] ^ 48;
}
int a[1048576], b[1048576], g[1048576], h[1048576], i, j, k, m, n, o;
inline void up(int u) { g[u] = min(g[u << 1], g[u << 1 | 1]); }
inline void add(int u, int v) { g[u] += v, h[u] += v; }
inline void down(int u) {
  if (h[u]) add(u << 1, h[u]), add(u << 1 | 1, h[u]), h[u] = 0;
}
inline void push(int u) {
  for (j = o; j; j--) down(u >> j);
}
inline void add(int u, int v, int w) {
  for (push(u += m - 1), push(v += m + 1); u ^ v ^ 1;
       up(u >>= 1), up(v >>= 1)) {
    if (~u & 1) add(u ^ 1, w);
    if (v & 1) add(v ^ 1, w);
  }
  while (u >>= 1) up(u);
}
inline int query() {
  int u = 1;
  for (; u < m; u = u << 1 | (g[u << 1] > 0)) down(u);
  return u ^ m;
}
inline void add(int u) {
  while (u <= n) h[u]++, u += u & -u;
}
inline void del(int u) {
  while (u <= n) h[u]--, u += u & -u;
}
inline int sum(int u) {
  int x = 0;
  while (u) x += h[u], u ^= u & -u;
  return x;
}
int main() {
  freopen("test.in", "r", stdin);
  fread(G, 1, 3500000, stdin), n = read(), k = read();
  for (i = 1; i <= n; i++) b[a[i] = read()] = i;
  for (m = 1; m < n + 2; m <<= 1) o++;
  for (i = 1; i <= n; i++)
    g[m | b[i]] = sum(min(n, b[i] + k - 1)) - sum(max(0, b[i] - k)), add(b[i]);
  for (i = g[m] = n + 1, memset(h + 1, 0, n << 2); i < m; i++) g[m | i] = n + 1;
  for (i = m, H = G; --i;) up(i);
  for (i = 1; i <= n; i++)
    a[b[i] = query()] = i, add(b[i], b[i], n + 1),
             add(max(1, b[i] - k + 1), min(n, b[i] + k - 1), -1);
  for (i = 1; i <= n; *H++ = '\n', i++) print(a[i]);
  return 0 & fwrite(G, 1, H - G, stdout);
}
