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 = (int)5e5 + 123, mod = (int)1e9 + 7, inf = (int)1e9;
int n, k, a[N], b[N], t[4 * N], cnt[N];
vector<int> up[N];
void upd(int v, int tl, int tr, int pos, int val) {
  if (tl == tr) {
    t[v] = val;
    return;
  }
  int tm = (tl + tr) / 2;
  if (pos <= tm)
    upd(v + v, tl, tm, pos, val);
  else
    upd(v + v + 1, tm + 1, tr, pos, val);
  t[v] = min(t[v + v], t[v + v + 1]);
}
int get(int v, int tl, int tr, int l, int r) {
  if (r < tl || tr < l) return inf;
  if (l <= tl && tr <= r) return t[v];
  int tm = (tl + tr) / 2;
  return min(get(v + v, tl, tm, l, r), get(v + v + 1, tm + 1, tr, l, r));
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    b[a[i]] = i;
  }
  a[n + 1] = b[n + 1] = n + 1;
  for (int i = 1; i <= n; i++) upd(1, 1, n, i, n + 1);
  for (int i = n; i >= 1; i--) {
    int x = b[i];
    int l = get(1, 1, n, x - k + 1, x);
    int r = get(1, 1, n, x, x + k - 1);
    upd(1, 1, n, x, i);
    up[b[l]].push_back(i);
    up[b[r]].push_back(i);
  }
  priority_queue<int> q;
  vector<int> ans;
  q.push(n + 1);
  while (!q.empty()) {
    int v = q.top();
    ans.push_back(v);
    q.pop();
    for (int i = 0; i < up[v].size(); i++) {
      int x = up[v][i];
      cnt[x]++;
      if (cnt[x] == 2) q.push(b[x]);
    }
  }
  reverse(ans.begin(), ans.end());
  for (int i = 0; i < n; i++) cout << ans[i] << endl;
  return 0;
}
