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;
pair<int, int> tree[100010 << 2];
void change(int u, int l, int r, pair<int, int> x) {
  tree[u] = max(tree[u], x);
  if (l == r) return;
  int mid = (l + r) >> 1;
  if (x.second <= mid)
    change(u << 1, l, mid, x);
  else
    change(u << 1 | 1, mid + 1, r, x);
}
pair<int, int> answer(int u, int l, int r, int L, int R) {
  if (L <= l && r <= R) return tree[u];
  if (R < L) return make_pair(0, 0);
  int mid = (l + r) >> 1;
  pair<int, int> ans = make_pair(0, 0);
  if (L <= mid) ans = max(ans, answer(u << 1, l, mid, L, R));
  if (R > mid) ans = max(ans, answer(u << 1 | 1, mid + 1, r, L, R));
  return ans;
}
int nxt[100010 << 1], to[100010 << 1], head[100010], in[100010], cnt;
int p[100010];
void add(int u, int v) {
  nxt[++cnt] = head[u];
  to[cnt] = v;
  in[v]++;
  head[u] = cnt;
}
priority_queue<int, vector<int>, greater<int> > q;
int ans[100010];
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) {
    int a;
    scanf("%d", &a);
    p[a] = i;
  }
  for (int i = 1; i <= n; i++) {
    change(1, 1, n, make_pair(i, p[i]));
    pair<int, int> l = answer(1, 1, n, max(1, p[i] - k + 1), p[i] - 1),
                   r = answer(1, 1, n, p[i] + 1, min(p[i] + k - 1, n));
    if (l.first > 0) add(l.second, p[i]);
    if (r.first > 0) add(r.second, p[i]);
  }
  for (int i = 1; i <= n; i++)
    if (!in[i]) q.push(i);
  int tot = 0;
  while (!q.empty()) {
    int u = q.top();
    q.pop();
    ans[u] = ++tot;
    for (int i = head[u]; i; i = nxt[i]) {
      int v = to[i];
      in[v]--;
      if (!in[v]) q.push(v);
    }
  }
  for (int i = 1; i <= tot; i++) printf("%d\n", ans[i]);
  return 0;
}
