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 inf = 1000000000;
const int N = 500010;
int n, ncnt, c[N], a[N], lnum[2 * N], rnum[2 * N], lch[2 * N], rch[2 * N],
    delta[2 * N], key[2 * N], ans[N], deg[N];
pair<int, int> b[N];
priority_queue<int> q;
inline int lowbit(int first) { return first & (-first); }
void change(int first) {
  while (first <= n) {
    c[first]++;
    first += lowbit(first);
  }
}
int query(int first) {
  int second = 0;
  while (first) {
    second += c[first];
    first -= lowbit(first);
  }
  return second;
}
void build(int k, int l, int r) {
  lnum[k] = l;
  rnum[k] = r;
  delta[k] = 0;
  if (l == r) {
    if (!deg[l])
      key[k] = inf;
    else
      key[k] = deg[l];
    return;
  }
  int mid = (l + r) >> 1;
  lch[k] = ++ncnt;
  build(ncnt, l, mid);
  rch[k] = ++ncnt;
  build(ncnt, mid + 1, r);
  key[k] = min(key[k], min(key[lch[k]], key[rch[k]]));
}
void pushdown(int k) {
  if (delta[k]) {
    delta[lch[k]] += delta[k];
    key[lch[k]] -= delta[k];
    delta[rch[k]] += delta[k];
    key[rch[k]] -= delta[k];
    delta[k] = 0;
  }
}
void modify(int k, int l, int r) {
  if (lnum[k] == rnum[k] && key[k] == 1) {
    q.push(lnum[k]);
    key[k] = inf;
    return;
  }
  if (l <= lnum[k] && r >= rnum[k] && key[k] > 1) {
    delta[k]++;
    key[k]--;
    return;
  }
  pushdown(k);
  if (l < lnum[rch[k]]) modify(lch[k], l, r);
  if (r > rnum[lch[k]]) modify(rch[k], l, r);
  key[k] = min(key[k], min(key[lch[k]], key[rch[k]]));
}
int main() {
  int k;
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) b[i] = make_pair(a[i], i);
  sort(b + 1, b + n + 1);
  memset(c, 0, sizeof(c));
  for (int i = n; i; i--) {
    int l = max(1, b[i].second - k + 1), r = min(n, b[i].second + k - 1);
    deg[b[i].second] = query(r) - query(l - 1);
    if (!deg[b[i].second]) q.push(b[i].second);
    change(b[i].second);
  }
  ncnt = 0;
  build(0, 1, n);
  for (int i = n; i; i--) {
    int first = q.top();
    q.pop();
    ans[first] = i;
    int l = max(1, first - k + 1), r = min(n, first + k - 1);
    modify(0, l, r);
  }
  for (int i = 1; i <= n; i++) printf("%d\n", ans[i]);
  return 0;
}
