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>
const double PI = acos(-1.0);
const int DIR = 4;
const int X[] = {1, 0, -1, 0};
const int Y[] = {0, 1, 0, -1};
const int N = (int)5e5 + 228;
using namespace std;
int n, k, p[N], q[N], t1[N], t2[N], t[N << 1];
vector<pair<int, int> > g[N];
bool used[N];
int get(int l, int r) {
  l += n - 1, r += n - 1;
  int res = n + 1;
  while (l <= r) {
    if (l & 1) res = min(res, t[l++]);
    if (!(r & 1)) res = min(res, t[r--]);
    l >>= 1, r >>= 1;
  }
  return res;
}
void upd(int v, int val) {
  v += n - 1;
  t[v] = val;
  while (v != 1) {
    v >>= 1;
    t[v] = min(t[v << 1], t[v << 1 | 1]);
  }
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &p[i]);
  for (int i = 1; i <= n; i++) q[p[i]] = i;
  fill(t + 1, t + (n << 1), n + 1);
  for (int i = n; i >= 1; i--) {
    upd(q[i], i);
    t2[q[i]] = get(q[i] + 1, min(n, q[i] + k - 1));
    t1[q[i]] = get(max(1, q[i] - k + 1), q[i] - 1);
    g[t1[q[i]]].push_back({q[i], t2[q[i]]});
    g[t2[q[i]]].push_back({q[i], t1[q[i]]});
  }
  set<int> st;
  used[n + 1] = true;
  for (auto it : g[n + 1]) {
    if (used[it.second]) st.insert(it.first);
  }
  vector<int> ans;
  while (!st.empty()) {
    int v = *st.rbegin();
    st.erase(v);
    ans.push_back(v);
    used[p[v]] = true;
    for (auto it : g[p[v]]) {
      if (used[it.second]) {
        st.insert(it.first);
      }
    }
  }
  reverse(ans.begin(), ans.end());
  for (auto it : ans) printf("%d\n", it);
  return 0;
}
