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;
template <class T>
inline void read(T &x) {
  x = 0;
  char c = getchar();
  int f = 1;
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    x = x * 10 + c - '0';
    c = getchar();
  }
  x *= f;
}
template <class T>
inline void umin(T &x, T y) {
  x = x < y ? x : y;
}
template <class T>
inline void umax(T &x, T y) {
  x = x > y ? x : y;
}
inline unsigned int R() {
  static unsigned int seed = 416;
  return seed ^= seed >> 5, seed ^= seed << 17, seed ^= seed >> 13;
}
const int N = 550000, inf = 0x3f3f3f3f;
int n, a[N], ans[N], k, e[N][2], sz[N], m, v[N << 2];
inline void getinv(int *a, int *b) {
  static int c[N];
  for (register int i = (1); i <= (n); i++) c[a[i]] = i;
  for (register int i = (1); i <= (n); i++) b[i] = c[i];
}
int find(int l, int r) {
  l = max(l, 1);
  r = min(r, n);
  if (l > r) return 0;
  l = l + m - 1, r = r + m + 1;
  int res = inf;
  while ((l >> 1) != (r >> 1)) {
    if (!(l & 1)) res = min(res, v[l + 1]);
    if (r & 1) res = min(res, v[r - 1]);
    l >>= 1;
    r >>= 1;
  }
  return res < inf ? res : 0;
}
int main() {
  read(n);
  read(k);
  for (register int i = (1); i <= (n); i++) read(a[i]);
  getinv(a, a);
  for (m = 1; m <= n + 1; m <<= 1)
    ;
  memset(v, 0x3f3f3f3f, sizeof(v));
  for (register int i = (n); i >= (1); i--) {
    int t = find(a[i] + 1, a[i] + k - 1);
    if (t) e[a[i]][sz[a[i]]++] = a[t];
    t = find(a[i] - k + 1, a[i] - 1);
    if (t) e[a[i]][sz[a[i]]++] = a[t];
    v[m + a[i]] = i;
    for (int j = m + a[i] >> 1; j; j >>= 1)
      v[j] = min(v[j << 1], v[j << 1 | 1]);
  }
  static int deg[N];
  priority_queue<int, vector<int>, greater<int> > heap;
  for (register int i = (1); i <= (n); i++)
    if (!deg[i]) heap.push(i);
  int now = 0;
  while (!heap.empty()) {
    int u = heap.top();
    heap.pop();
    ans[++now] = u;
    for (register int i = (0); i <= (sz[u] - 1); i++) {
      if (!--deg[e[u][i]]) {
        heap.push(e[u][i]);
      }
    }
  }
  getinv(ans, ans);
  for (register int i = (1); i <= (n); i++) printf("%d\n", ans[i]);
  return 0;
}
