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 N = 5e5 + 10;
const int inf = 0x3f3f3f3f;
struct E {
  int v, nt;
} e[N << 1];
int n, K, tot, h[N], q[N], p[N], deg[N], seg[N];
priority_queue<int, vector<int>, greater<int> > que;
inline int max(int a, int b) { return a > b ? a : b; }
inline int min(int a, int b) { return a < b ? a : b; }
inline void add(int u, int v) { e[++tot] = (E){v, h[u]}, h[u] = tot, ++deg[v]; }
template <class T>
inline void in(T &x) {
  x = 0;
  int f = 1;
  char ch = getchar();
  for (; ch < '0' || ch > '9';) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  for (; ch >= '0' && ch <= '9';) x = x * 10 + ch - '0', ch = getchar();
  x *= f;
}
inline void build(int o, int l, int r) {
  seg[o] = inf;
  if (l == r) return;
  int mid = l + r >> 1, lc = o << 1, rc = lc | 1;
  build(lc, l, mid), build(rc, mid + 1, r);
}
inline void update(int o, int l, int r, int q, int v) {
  if (l == r) {
    seg[o] = v;
    return;
  }
  int mid = l + r >> 1, lc = o << 1, rc = lc | 1;
  if (q <= mid)
    update(lc, l, mid, q, v);
  else
    update(rc, mid + 1, r, q, v);
  seg[o] = min(seg[lc], seg[rc]);
}
inline int query(int o, int l, int r, int L, int R) {
  if (L <= l && r <= R) return seg[o];
  int mid = l + r >> 1, lc = o << 1, rc = lc | 1, ret = inf;
  if (L <= mid) ret = min(ret, query(lc, l, mid, L, R));
  if (R > mid) ret = min(ret, query(rc, mid + 1, r, L, R));
  return ret;
}
int main() {
  int x, v;
  in(n), in(K), build(1, 1, n);
  for (int i = 1; i <= n; ++i) in(p[i]), q[p[i]] = i;
  for (int i = n; i; --i) {
    x = query(1, 1, n, max(1, q[i] - K + 1), q[i]);
    if (x <= n) add(q[i], q[x]);
    x = query(1, 1, n, q[i], min(q[i] + K - 1, n));
    if (x <= n) add(q[i], q[x]);
    update(1, 1, n, q[i], i);
  }
  for (int i = 1; i <= n; ++i)
    if (!deg[i]) que.push(i);
  for (int l = 1; l <= n; ++l) {
    x = q[l] = que.top(), que.pop();
    for (int i = h[x]; i; i = e[i].nt)
      if (!(--deg[v = e[i].v])) que.push(v);
  }
  for (int i = 1; i <= n; ++i) p[q[i]] = i;
  for (int i = 1; i <= n; ++i) printf("%d\n", p[i]);
  return 0;
}
