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 MAXN = 5e5 + 10, INF = 1e9;
int p[MAXN], q[MAXN];
int f[MAXN];
int find(int p) {
  ++p;
  p = max(p, 0);
  int res = 0;
  for (; p; p -= p & -p) res += f[p];
  return res;
}
void add(int p) {
  ++p;
  for (; p < MAXN; p += p & -p) ++f[p];
}
int deg[MAXN];
pair<int, int> segment[4 * MAXN];
int lazy[4 * MAXN];
void build(int v, int b, int e) {
  if (e - b == 1) {
    segment[v] = {deg[b], b};
    return;
  }
  int mid = (b + e) / 2;
  build(2 * v, b, mid);
  build(2 * v + 1, mid, e);
  if (segment[2 * v + 1].first <= segment[2 * v].first)
    segment[v] = segment[2 * v + 1];
  else
    segment[v] = segment[2 * v];
}
void shift(int v) {
  lazy[2 * v] += lazy[v];
  lazy[2 * v + 1] += lazy[v];
  segment[2 * v].first -= lazy[v];
  segment[2 * v + 1].first -= lazy[v];
  lazy[v] = 0;
}
void clr(int v, int b, int e, int p) {
  if (p < b || e <= p) return;
  if (e - b == 1) {
    segment[v] = {INF, b};
    return;
  }
  int mid = (b + e) / 2;
  shift(v);
  clr(2 * v, b, mid, p);
  clr(2 * v + 1, mid, e, p);
  if (segment[2 * v + 1].first <= segment[2 * v].first)
    segment[v] = segment[2 * v + 1];
  else
    segment[v] = segment[2 * v];
}
void upd(int v, int b, int e, int l, int r) {
  if (r <= b || e <= l) return;
  if (l <= b && e <= r) {
    ++lazy[v];
    --segment[v].first;
    return;
  }
  int mid = (b + e) / 2;
  shift(v);
  upd(2 * v, b, mid, l, r);
  upd(2 * v + 1, mid, e, l, r);
  if (segment[2 * v + 1].first <= segment[2 * v].first)
    segment[v] = segment[2 * v + 1];
  else
    segment[v] = segment[2 * v];
}
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n, k;
  cin >> n >> k;
  --k;
  for (int i = 0; i < n; ++i) {
    cin >> p[i];
    --p[i];
    q[p[i]] = i;
  }
  for (int i = n - 1; i >= 0; --i) {
    deg[q[i]] = find(q[i] + k) - find(q[i] - k - 1);
    add(q[i]);
  }
  build(1, 0, n);
  for (int i = n - 1; i >= 0; --i) {
    p[segment[1].second] = i;
    q[i] = segment[1].second;
    clr(1, 0, n, q[i]);
    upd(1, 0, n, q[i] - k, q[i] + k + 1);
  }
  for (int i = 0; i < n; ++i) cout << p[i] + 1 << '\n';
  return 0;
}
