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;
inline int gi() {
  int f = 1, sum = 0;
  char ch = getchar();
  while (ch > '9' || ch < '0') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    sum = (sum << 3) + (sum << 1) + ch - '0';
    ch = getchar();
  }
  return f * sum;
}
const int N = 500010;
int p[N], a[N], n, k, d[N], tot, ans[N];
vector<int> G[N];
priority_queue<int, vector<int>, greater<int> > Q;
void Add(int u, int v) {
  G[u].push_back(v);
  d[v]++;
}
int t[N << 1];
void modify(int o, int l, int r, int pos, int v) {
  if (l == r) {
    t[o] = v;
    return;
  }
  int mid = (l + r) >> 1;
  if (pos <= mid)
    modify(o << 1, l, mid, pos, v);
  else
    modify(o << 1 | 1, mid + 1, r, pos, v);
}
int query(int o, int l, int r, int posl, int posr) {
  if (posl > posr) return t[0];
  if (posl <= l && r <= posr) return t[o];
  int mid = (l + r) >> 1, ret = t[0];
  if (posl <= mid) ret = min(ret, query(o << 1, l, mid, posl, posr));
  if (mid < posr) ret = min(ret, query(o << 1 | 1, mid + 1, r, posl, posr));
  return ret;
}
int main() {
  n = gi();
  k = gi();
  for (int i = 1; i <= n; i++) p[i] = gi(), a[p[i]] = i;
  memset(t, 63, sizeof(t));
  for (int i = n; i; i--) {
    int x = query(1, 1, n, a[i] + 1, min(n, a[i] + x - 1));
    if (x < t[0]) Add(a[i], a[x]);
    x = query(1, 1, n, 1, a[i] - 1);
    if (x < t[0]) Add(a[i], a[x]);
    modify(1, 1, n, a[i], i);
  }
  for (int i = 1; i <= n; i++)
    if (!d[i]) Q.push(i);
  while (!Q.empty()) {
    int u = Q.top();
    Q.pop();
    ans[u] = ++tot;
    for (int v : G[u]) {
      d[v]--;
      if (!d[v]) Q.push(v);
    }
  }
  for (int i = 1; i <= n; i++) printf("%d\n", ans[i]);
  return 0;
}
