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 mod = 1e9 + 7;
inline int pls(int x, int y) {
  x += y;
  return x >= mod ? x - mod : x;
}
inline int dec(int x, int y) {
  x -= y;
  return x < 0 ? x + mod : x;
}
inline int mul(int x, int y) { return 1ll * x * y % mod; }
inline int mul(int x, int y, int z) { return mul(mul(x, y), z); }
inline int mul(int x, int y, int z, int p) { return mul(mul(x, y), mul(z, p)); }
inline void add(int &x, int y) {
  x += y;
  x = (x >= mod) ? x - mod : x;
}
inline int fpw(int x, int y, int r = 1) {
  for (; y; y >>= 1, x = mul(x, x))
    if (y & 1) r = mul(r, x);
  return r;
}
inline int inv(int x) { return fpw(x, mod - 2); }
inline int gi() {
  int x;
  int _w = scanf("%d", &x);
  return x;
}
inline void gi(int &x) { int _w = scanf("%d", &x); }
inline void write(int x) { printf("%d\n", x); }
void chkmax(int &x, int y) { x = (x > y) ? x : y; }
void chkmin(int &x, int y) { x = (x < y) ? x : y; }
const int INF = 0x3f3f3f3f;
template <typename T>
inline void debug(T x) {
  cerr << x;
  return;
}
int n, k;
const int maxn = 1e5 + 10;
int a[maxn], p[maxn], deg[maxn], b[maxn];
vector<int> e[maxn];
int mn[maxn << 2];
void add(int p, int x, int y, int pos, int d) {
  if (x == y) {
    mn[p] = d;
    return;
  }
  int mid = (x + y) >> 1;
  if (pos <= mid)
    add(p << 1, x, mid, pos, d);
  else
    add(p << 1 | 1, mid + 1, y, pos, d);
  mn[p] = min(mn[p << 1], mn[p << 1 | 1]);
}
int qry(int p, int x, int y, int l, int r) {
  if (x == l && y == r) return mn[p];
  int mid = (x + y) >> 1;
  if (r <= mid)
    return qry(p << 1, x, mid, l, r);
  else if (l > mid)
    return qry(p << 1 | 1, mid + 1, y, l, r);
  else
    return min(qry(p << 1, x, mid, l, mid),
               qry(p << 1 | 1, mid + 1, y, mid + 1, r));
}
int main() {
  memset(mn, 0x3f, sizeof mn);
  n = gi();
  k = gi();
  for (int i = 1; i <= n; ++i) p[i] = gi(), a[p[i]] = i;
  for (int i = n; i >= 1; --i) {
    int pos;
    pos = qry(1, 1, n, a[i], min(a[i] + k - 1, n));
    if (pos != INF) e[i].push_back(pos), deg[pos]++;
    pos = qry(1, 1, n, max(1, a[i] - k + 1), a[i]);
    if (pos != INF) e[i].push_back(pos), deg[pos]++;
    add(1, 1, n, a[i], i);
  }
  priority_queue<pair<int, int>, vector<pair<int, int> >,
                 greater<pair<int, int> > >
      q;
  for (int i = 1; i <= n; ++i)
    if (!deg[i]) q.push({a[i], i});
  int cnt = 0;
  while (q.size()) {
    int t = q.top().second;
    q.pop();
    b[++cnt] = a[t];
    for (auto v : e[t]) {
      deg[v]--;
      if (!deg[v]) q.push({a[v], v});
    }
  }
  for (int i = 1; i <= n; ++i) p[b[i]] = i;
  for (int i = 1; i <= n; ++i) printf("%d\n", p[i]);
  return 0;
}
