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;
struct FT {
  vector<long long> s;
  FT(int n) : s(n) {}
  void update(int pos, long long dif) {
    for (; pos < (int)(s).size(); pos |= pos + 1) s[pos] += dif;
  }
  long long query(int pos) {
    long long res = 0;
    for (; pos > 0; pos &= pos - 1) res += s[pos - 1];
    return res;
  }
  int lower_bound(long long sum) {
    if (sum <= 0) return -1;
    int pos = 0;
    for (int pw = 1 << 25; pw; pw >>= 1) {
      if (pos + pw <= (int)(s).size() && s[pos + pw - 1] < sum)
        pos += pw, sum -= s[pos - 1];
    }
    return pos;
  }
};
struct node {
  set<int> v;
  node *l, *r;
};
node* build(int lx, int rx, vector<int>& p) {
  node* v = new node();
  for (int a = lx; a <= rx; a++) {
    v->v.insert(p[a]);
  }
  if (lx == rx) {
    v->l = v->r = nullptr;
  } else {
    v->l = build(lx, (lx + rx) / 2, p);
    v->r = build((lx + rx) / 2 + 1, rx, p);
  }
  return v;
}
const int M = 1e8;
int query_min(node* v, int lx, int rx, int qlx, int qrx) {
  if (qlx > rx || lx > qrx) return M;
  if (qlx <= lx && rx <= qrx) {
    if (!v->v.empty()) return *v->v.begin();
    return M;
  } else {
    return min(query_min(v->l, lx, (lx + rx) / 2, qlx, qrx),
               query_min(v->r, (lx + rx) / 2 + 1, rx, qlx, qrx));
  }
}
void kill(node* v, int lx, int rx, int kx, int val) {
  if (kx < lx || rx < kx) return;
  v->v.erase(val);
  if (lx == rx) return;
  kill(v->l, lx, (lx + rx) / 2, kx, val);
  kill(v->r, (lx + rx) / 2 + 1, rx, kx, val);
}
vector<int> a, p;
int n;
int k;
vector<int> res;
node* segtree;
void solve(int lx, int rx, int d) {
  int v = query_min(segtree, 0, n - 1, lx, rx);
  if (v > d + k) return;
  if (v == M) return;
  int idx = a[v];
  solve(lx, idx - 1, v);
  res.push_back(v);
  kill(segtree, 0, n - 1, idx, v);
  solve(lx, rx, d);
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  cin >> k;
  a.resize(n), p.resize(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    a[i]--;
    p[a[i]] = i;
  }
  k--;
  segtree = build(0, n - 1, p);
  solve(0, n - 1, M);
  vector<int> ans(n);
  for (int i = 0; i < n; i++) ans[res[i]] = i;
  for (int i = 0; i < n; i++) {
    cout << ans[i] + 1 << '\n';
  }
}
