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 MAXN = 500005;
int read() {
  int x;
  scanf("%d", &x);
  return x;
}
struct node {
  int ch[2];
  int val;
} t[MAXN << 2];
int tot, N, K, num;
int a[MAXN], b[MAXN];
void PU(int u) {
  t[u].val = t[t[u].ch[1]].val ? t[t[u].ch[1]].val : t[t[u].ch[0]].val;
}
void insert(int u, int tl, int tr, int p) {
  if (tl == tr) {
    t[u].val = p;
    return;
  }
  int mid = (tl + tr) >> 1;
  if (p <= mid) {
    if (!t[u].ch[0]) t[u].ch[0] = ++tot;
    insert(t[u].ch[0], tl, mid, p);
  } else {
    if (!t[u].ch[1]) t[u].ch[1] = ++tot;
    insert(t[u].ch[1], mid + 1, tr, p);
  }
  PU(u);
}
int Query(int u, int tl, int tr, int l, int r) {
  if (l > r) return 0;
  if (!u) return 0;
  if (tl >= l && tr <= r) return t[u].val;
  if (tr < l || tl > r) return 0;
  int mid = (tl + tr) >> 1;
  int x = Query(t[u].ch[0], tl, mid, l, r),
      y = Query(t[u].ch[1], mid + 1, tr, l, r);
  return y ? y : x;
}
int head[MAXN], du[MAXN];
priority_queue<int> Q;
struct line {
  int nxt, to;
} e[MAXN];
int Ans[MAXN], p[MAXN], cnt;
void add(int u, int v) {
  e[num] = (line){head[u], v};
  head[u] = num, num++, du[v]++;
}
int main() {
  memset(head, -1, sizeof(head));
  N = read(), K = read(), tot = 1;
  for (int i = 1; i <= N; i++) a[i] = read(), b[a[i]] = i;
  for (int i = 1; i <= N; i++) {
    insert(1, 1, N, b[i]);
    int x = Query(1, 1, N, b[i] - K + 1, b[i] - 1),
        y = Query(1, 1, N, b[i] + 1, b[i] + K - 1);
    if (x) add(b[i], x);
    if (y) add(b[i], y);
  }
  for (int i = 1; i <= N; i++)
    if (!du[i]) Q.push(i);
  cnt = N;
  while (!Q.empty()) {
    int x = Q.top();
    Q.pop();
    Ans[cnt--] = x;
    for (int i = head[x]; ~i; i = e[i].nxt) {
      du[e[i].to]--;
      if (!du[e[i].to]) Q.push(e[i].to);
    }
  }
  for (int i = 1; i <= N; i++) p[Ans[i]] = i;
  for (int i = 1; i <= N; i++) printf("%d\n", p[i]);
  return 0;
}
