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;
int n, k, cnt, sum, root, a[500005], ans[500005], minn[500005 << 2],
    son[500005][2];
void change(int &x, int l, int r, int pos, int d) {
  if (!x) x = ++cnt;
  minn[x] = min(minn[x], d);
  if (l == r) return;
  int mid = (l + r) >> 1;
  if (pos <= mid)
    change(son[x][0], l, mid, pos, d);
  else
    change(son[x][1], mid + 1, r, pos, d);
}
int query(int x, int l, int r, int tl, int tr) {
  if (!x) return 0x3f3f3f3f;
  if (l >= tl && r <= tr) return minn[x];
  int mid = (l + r) >> 1, res = 0x3f3f3f3f;
  if (tr > mid) res = min(res, query(son[x][1], mid + 1, r, tl, tr));
  if (tl <= mid) res = min(res, query(son[x][0], l, mid, tl, tr));
  return res;
}
template <typename T>
inline void read(T &t) {
  t = 0;
  char c = getchar();
  int f = 1;
  while (c < '0' || c > '9') {
    if (c == '-') f = -f;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    t = (t << 3) + (t << 1) + c - '0';
    c = getchar();
  }
  t *= f;
}
template <typename T, typename... Args>
inline void read(T &t, Args &...args) {
  read(t);
  read(args...);
}
template <typename T>
inline void write(T x) {
  if (x < 0) {
    x = -x;
    putchar('-');
  }
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
int toop = 1, to[500005], nxt[500005], deg[500005], head[500005];
void Add_Edge(int u, int v) {
  to[++toop] = v, nxt[toop] = head[u], head[u] = toop;
}
signed main() {
  read(n, k);
  memset(minn, 0x3f, sizeof(minn));
  for (register int i = 1, x; i <= n; ++i) read(x), a[x] = i;
  for (register int i = n; i; --i) {
    int lr = query(root, 1, n, a[i], min(n, a[i] + k - 1));
    if (lr != 0x3f3f3f3f) Add_Edge(a[i], a[lr]), deg[a[lr]]++;
    int rr = query(root, 1, n, max(1, a[i] - k + 1), a[i]);
    if (rr != 0x3f3f3f3f) Add_Edge(a[i], a[rr]), deg[a[rr]]++;
    change(root, 1, n, a[i], i);
  }
  priority_queue<int, vector<int>, greater<int> > q;
  for (register int i = 1; i <= n; ++i)
    if (!deg[i]) q.push(i);
  while (!q.empty()) {
    int u = q.top();
    q.pop();
    ans[u] = ++sum;
    for (register int i = head[u]; i; i = nxt[i])
      if (--deg[to[i]] == 0) q.push(to[i]);
  }
  for (register int i = 1; i <= n; ++i) write(ans[i]), putchar('\n');
  return 0;
}
