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 = 500010, inf = 0x7fffffff;
int n, k, p[maxn], q[maxn], minn[maxn << 2], du[maxn], ans[maxn], cnt;
vector<int> V[maxn];
void pushup(int o) { minn[o] = min(minn[o * 2], minn[o * 2 + 1]); }
void build(int o, int l, int r) {
  if (l == r) {
    minn[o] = inf;
    return;
  }
  int mid = (l + r) >> 1;
  build(o * 2, l, mid);
  build(o * 2 + 1, mid + 1, r);
  pushup(o);
}
int query(int o, int l, int r, int x, int y) {
  if (x > y) return inf;
  if (x <= l && r <= y) return minn[o];
  int mid = (l + r) >> 1, res = inf;
  if (x <= mid) res = min(res, query(o * 2, l, mid, x, y));
  if (y > mid) res = min(res, query(o * 2 + 1, mid + 1, r, x, y));
  return res;
}
void update(int o, int l, int r, int pos, int v) {
  if (l == r) {
    minn[o] = v;
    return;
  }
  int mid = (l + r) >> 1;
  if (pos <= mid)
    update(o * 2, l, mid, pos, v);
  else
    update(o * 2 + 1, mid + 1, r, pos, v);
  pushup(o);
}
void topo() {
  priority_queue<int, vector<int>, greater<int> > q;
  for (int i = 1; i <= n; i++)
    if (!du[i]) q.push(i);
  while (!q.empty()) {
    int u = q.top();
    q.pop();
    ans[++cnt] = u;
    for (int i = 0; i < V[u].size(); i++) {
      int v = V[u][i];
      if (--du[v] == 0) q.push(v);
    }
  }
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &p[i]);
    q[p[i]] = i;
  }
  build(1, 1, n);
  for (int i = n; i >= 1; i--) {
    int pos = query(1, 1, n, max(q[i] - k + 1, 1), q[i]);
    if (pos != inf) {
      V[q[i]].push_back(q[pos]);
      du[q[pos]]++;
    }
    pos = query(1, 1, n, q[i], min(n, q[i] + k - 1));
    if (pos != inf) {
      V[q[i]].push_back(q[pos]);
      du[q[pos]]++;
    }
    update(1, 1, n, q[i], i);
  }
  for (int i = 1; i <= n; i++) sort(V[i].begin(), V[i].end());
  topo();
  for (int i = 1; i <= n; i++) printf("%d\n", ans[i]);
  return 0;
}
