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 = 2e6 + 10;
const int MAXM = 4e6 + 10;
int N, K;
int P[MAXN], A[MAXN];
int cnt = 1, Head[MAXN], Next[MAXM], To[MAXM], deg[MAXN];
int tr[MAXN << 2];
priority_queue<int, vector<int>, greater<int> > q;
inline void add_edge(int x, int y) {
  Next[++cnt] = Head[x], To[cnt] = y, Head[x] = cnt;
  ++deg[y];
}
inline void build(int rt, int l, int r) {
  if (l == r) return tr[rt] = N + 1, void();
  int mid = (l + r) >> 1;
  build(rt << 1, l, mid), build(rt << 1 | 1, mid + 1, r);
}
inline void update(int rt, int l, int r, int x, int d) {
  if (l == r) return tr[rt] = d, void();
  int mid = (l + r) >> 1;
  if (x <= mid)
    update(rt << 1, l, mid, x, d);
  else
    update(rt << 1 | 1, mid + 1, r, x, d);
  tr[rt] = min(tr[rt << 1], tr[rt << 1 | 1]);
}
inline int query(int rt, int l, int r, int x, int y) {
  if (x <= l && r <= y) return tr[rt];
  if (y < l || r < x) return N + 1;
  int mid = (l + r) >> 1, res = N + 1;
  if (x <= mid) res = min(res, query(rt << 1, l, mid, x, y));
  if (mid < y) res = min(res, query(rt << 1 | 1, mid + 1, r, x, y));
  return res;
}
int main() {
  register int i;
  scanf("%d%d", &N, &K);
  for (i = 1; i <= N; ++i) scanf("%d", P + i), A[P[i]] = i;
  build(1, 1, N);
  for (i = N; i; --i) {
    int tp1 = query(1, 1, N, max(A[i] - K + 1, 1), A[i]);
    int tp2 = query(1, 1, N, A[i], min(A[i] + K - 1, N));
    if (tp1 <= N) add_edge(A[i], A[tp1]);
    if (tp2 <= N) add_edge(A[i], A[tp2]);
    update(1, 1, N, A[i], i);
  }
  for (i = 1; i <= N; ++i)
    if (!deg[i]) q.push(i);
  int t = 0;
  while (!q.empty()) {
    int x = q.top();
    q.pop();
    A[++t] = x;
    for (i = Head[x]; i; i = Next[i])
      if (!(--deg[To[i]])) q.push(To[i]);
  }
  for (i = 1; i <= N; ++i) P[A[i]] = i;
  for (i = 1; i <= N; ++i) printf("%d\n", P[i]);
  return 0;
}
