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 N = 1e6 + 7, M = 1e9;
int read() {
  int s = 0, t = 1, k = getchar() - 48;
  for (; k < 0 || 9 < k; k = getchar() - 48)
    if (k == -3) t = -1;
  for (; 0 <= k && k <= 9; k = getchar() - 48) s = (s << 1) + (s << 3) + k;
  return s * t;
}
int n, k;
int a[N];
void in() {
  cin >> n >> k;
  for (int i = 0; ++i <= n;) a[read()] = i;
}
struct tr {
  int l, r, m;
} tr[N + N];
void bui(int k, int l, int r) {
  tr[k].l = l;
  tr[k].r = r;
  tr[k].m = M;
  if (l == r) return;
  int m = l + r >> 1;
  bui(k * 2, l, m);
  bui(k * 2 + 1, m + 1, r);
}
void add(int k, int p, int v) {
  tr[k].m = v;
  if (tr[k].l == tr[k].r) return;
  if (tr[k * 2].r < p)
    add(k * 2 + 1, p, v);
  else
    add(k * 2, p, v);
}
int que(int k, int l, int r) {
  if (tr[k].r < l || r < tr[k].l) return M;
  if (l <= tr[k].l && tr[k].r <= r) return tr[k].m;
  int x = que(k * 2, l, r), y = que(k * 2 + 1, l, r);
  return min(x, y);
}
int t;
int h[N], d[N];
struct hh {
  int n, r;
} e[N];
void ins(int x, int y) {
  e[++t] = (hh){h[x], y};
  h[x] = t;
  ++d[y];
}
set<int> S;
int A[N];
void top() {
  for (int i = 0; ++i <= n;)
    if (!d[i]) S.insert(i);
  for (int j = 0; ++j <= n;) {
    A[j] = *S.begin();
    S.erase(A[j]);
    for (int i = h[A[j]]; i; i = e[i].n)
      if (--d[e[i].r] == 0) S.insert(e[i].r);
  }
}
void wor() {
  bui(1, 1, n);
  for (int i = n, x; i; --i) {
    x = que(1, a[i] - k + 1, a[i]);
    if (x <= n) ins(a[i], a[x]);
    x = que(1, a[i], a[i] + k - 1);
    if (x <= n) ins(a[i], a[x]);
    add(1, a[i], i);
  }
  top();
}
void out() {
  for (int i = 0; ++i <= n;) printf("%d\n", A[i]);
}
int main() {
  in();
  wor();
  out();
  exit(0);
}
