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;
void solve(vector<vector<int> > E, vector<int> &pos, vector<int> v,
           int pos_add) {
  int N = v.size();
  if (N == 0) return;
  vector<int> sub(N, 0);
  queue<int> q;
  q.push(0);
  vector<int> v1, v2;
  while (!q.empty()) {
    for (auto it = E[q.front()].begin(); it != E[q.front()].end(); it++)
      if (sub[*it] == 0) {
        sub[*it] = 1;
        q.push(*it);
      }
    q.pop();
  }
  for (int i = 1; i < N; i++) {
    if (sub[i] == 0)
      v2.push_back(v[i]);
    else
      v1.push_back(v[i]);
  }
  vector<int> num(N);
  int x1 = 0, x2 = 0;
  for (int i = 1; i < N; i++) {
    if (sub[i] == 0)
      num[i] = x2++;
    else
      num[i] = x1++;
  }
  vector<vector<int> > E1, E2;
  for (int i = 1; i < N; i++) {
    if (sub[i] == 1) {
      vector<int> w;
      for (int j = 0; j < (int)E[i].size(); j++)
        if (E[i][j] > 0 && sub[E[i][j]] == 1) w.push_back(num[E[i][j]]);
      E1.push_back(w);
    } else {
      vector<int> w;
      for (int j = 0; j < (int)E[i].size(); j++)
        if (E[i][j] > 0 && sub[E[i][j]] == 0) w.push_back(num[E[i][j]]);
      E2.push_back(w);
    }
  }
  pos[pos_add + v1.size()] = v[0];
  solve(E1, pos, v1, pos_add);
  solve(E2, pos, v2, pos_add + v1.size() + 1);
}
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(10);
  int N, K;
  cin >> N >> K;
  vector<int> A(N);
  for (int i = 0; i < N; i++) cin >> A[i];
  vector<int> lfte(N, -1), rte(N, -1);
  set<pair<int, int> > S;
  for (int i = 0; i < N; i++) {
    if (i > 0) S.insert(make_pair(A[i - 1], i - 1));
    if (i >= K) S.erase(make_pair(A[i - K], i - K));
    auto it = S.lower_bound(make_pair(A[i], -1));
    if (it != S.begin()) {
      it--;
      lfte[i] = it->second;
    }
  }
  S.clear();
  for (int i = N - 1; i >= 0; i--) {
    if (i < N - 1) S.insert(make_pair(A[i + 1], i + 1));
    if (i + K < N) S.erase(make_pair(A[i + K], i + K));
    auto it = S.lower_bound(make_pair(A[i], -1));
    if (it != S.begin()) {
      it--;
      rte[i] = it->second;
    }
  }
  vector<vector<int> > E(N);
  for (int i = 0; i < N; i++) {
    if (lfte[i] != -1) E[i].push_back(lfte[i]);
    if (rte[i] != -1) E[i].push_back(rte[i]);
  }
  vector<int> pos(N), v;
  for (int i = 0; i < N; i++) v.push_back(i);
  solve(E, pos, v, 0);
  vector<int> ans(N);
  for (int i = 0; i < N; i++) ans[pos[i]] = i + 1;
  for (int i = 0; i < N; i++) cout << ans[i] << "\n";
  return 0;
}
