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;
template <class S, class T>
ostream& operator<<(ostream& o, const pair<S, T>& p) {
  return o << "(" << p.first << "," << p.second << ")";
}
template <class T>
ostream& operator<<(ostream& o, const vector<T>& vc) {
  o << "sz = " << vc.size() << endl << "[";
  for (const T& v : vc) o << v << ",";
  o << "]";
  return o;
}
const int MN = 500000;
int N, K;
int a[MN], b[MN];
vector<int> G[MN];
int deg[MN];
int ans[MN];
void add_edge(int a, int b) {
  G[a].push_back(b);
  deg[b]++;
}
int main() {
  cin >> N >> K;
  for (int i = 0; i < (int)(N); i++) {
    cin >> a[i];
    a[i]--;
    b[a[i]] = i;
  }
  set<pair<int, int> > st;
  for (int i = 0; i < (int)(N); i++) {
    pair<int, int> p(a[i], i);
    st.insert(p);
    if (i >= K) {
      st.erase(pair<int, int>(a[i - K], i - K));
    }
    auto it = st.lower_bound(p);
    if (it != st.begin()) {
      it--;
      int l = it->second;
      add_edge(i, l);
      it++;
    }
    it++;
    if (it != st.end()) {
      int r = it->second;
      add_edge(r, i);
    }
  }
  priority_queue<int> que;
  for (int i = 0; i < (int)(N); i++)
    if (deg[i] == 0) que.push(i);
  for (int t = 0; t < (int)(N); t++) {
    int v = que.top();
    que.pop();
    ans[N - 1 - t] = v + 1;
    for (int u : G[v]) {
      deg[u]--;
      if (deg[u] == 0) que.push(u);
    }
  }
  for (int i = 0; i < (int)(N); i++) cout << ans[i] << endl;
}
