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 read() {
  register int x = 0, f = 1;
  register char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = 0;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + (ch ^ '0');
    ch = getchar();
  }
  return f ? x : -x;
}
const int N = 5e5 + 10, inf = 0x3f3f3f3f;
int n, k, a[N], b[N], ind[N];
vector<int> E[N];
priority_queue<int, vector<int>, greater<int> > q;
namespace SegmentTree {
int tr[N << 2];
inline void pushup(int p) { tr[p] = min(tr[p << 1], tr[p << 1 | 1]); }
inline void Build(int p, int l, int r) {
  tr[p] = inf;
  if (l == r) return;
  int mid = (l + r) >> 1;
  Build(p << 1, l, mid), Build(p << 1 | 1, mid + 1, r);
}
inline void Insert(int p, int l, int r, int pos, int v) {
  if (l == r) {
    tr[p] = v;
    return;
  }
  int mid = (l + r) >> 1;
  if (mid >= pos)
    Insert(p << 1, l, mid, pos, v);
  else
    Insert(p << 1 | 1, mid + 1, r, pos, v);
  pushup(p);
}
inline int Query(int p, int l, int r, int L, int R) {
  if (L > R) return inf;
  if (L <= l && r <= R) return tr[p];
  int mid = (l + r) >> 1, ans = inf;
  if (L <= mid) ans = min(ans, Query(p << 1, l, mid, L, R));
  if (mid < R) ans = min(ans, Query(p << 1 | 1, mid + 1, r, L, R));
  return ans;
}
}  // namespace SegmentTree
using namespace SegmentTree;
int main() {
  n = read(), k = read();
  for (int i = (1), ed = (n); i <= ed; ++i) a[i] = read(), b[a[i]] = i;
  Build(1, 1, n);
  for (int i = (n), ed = (1); i >= ed; --i) {
    int p = Query(1, 1, n, max(1, b[i] - k + 1), b[i] - 1);
    if (p ^ inf) E[b[i]].push_back(b[p]), ++ind[b[p]];
    p = Query(1, 1, n, b[i] + 1, min(n, b[i] + k - 1));
    if (p ^ inf) E[b[i]].push_back(b[p]), ++ind[b[p]];
    Insert(1, 1, n, b[i], i);
  }
  for (int i = (1), ed = (n); i <= ed; ++i)
    if (!ind[i]) q.push(i);
  int cnt = 0;
  while (q.size()) {
    int u = q.top();
    q.pop();
    a[u] = ++cnt;
    for (int v : E[u])
      if (!--ind[v]) q.push(v);
  }
  for (int i = (1), ed = (n - 1); i <= ed; ++i) printf("%d\n", a[i]);
  printf("%d", a[n]);
  return 0;
}
