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 MAXN = 500005;
const int INF = 1000000007;
int n, k, ofs;
int p[MAXN], fen[MAXN], d[MAXN], sol[MAXN];
struct node {
  int val, pos, prop;
  node() {
    val = INF;
    pos = prop = 0;
  }
  node(int _val, int _pos) {
    val = _val;
    pos = _pos;
    prop = 0;
  }
} t[MAXN * 3];
void propagate(int x) {
  if (t[x].prop == 0) return;
  if (x < ofs) {
    t[2 * x].prop += t[x].prop;
    t[2 * x + 1].prop += t[x].prop;
  }
  t[x].val += t[x].prop;
  t[x].prop = 0;
}
node spoji(node a, node b) {
  if (a.val < b.val) return a;
  if (a.val > b.val) return b;
  if (a.pos < b.pos) return a;
  return b;
}
void build() {
  ofs = 1;
  while (ofs < n) ofs *= 2;
  for (int i = 0; i < n; i++) {
    t[i + ofs] = node(d[i], i);
  }
  for (int i = ofs - 1; i > 0; i--) {
    t[i] = spoji(t[2 * i], t[2 * i + 1]);
  }
}
void update(int x, int from, int to, int low, int high, int val) {
  propagate(x);
  if (from <= low && high <= to) {
    t[x].prop += val;
    propagate(x);
    return;
  }
  if (to < low || high < from) return;
  update(2 * x, from, to, low, (low + high) / 2, val);
  update(2 * x + 1, from, to, (low + high) / 2 + 1, high, val);
  t[x] = spoji(t[2 * x], t[2 * x + 1]);
}
void ubaci(int x, int k) {
  for (; x < MAXN; x += x & -x) fen[x] += k;
}
int upit(int x) {
  int res = 0;
  for (; x > 0; x -= x & -x) res += fen[x];
  return res;
}
void get_deg() {
  for (int i = 0; i < k; i++) {
    ubaci(p[i], 1);
  }
  for (int i = 0; i < n; i++) {
    d[i] = upit(p[i]) - 1;
    if (i + k < n) ubaci(p[i + k], 1);
    if (i - k >= 0) ubaci(p[i - k], -1);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> p[i];
  }
  get_deg();
  build();
  for (int i = 1; i <= n; i++) {
    node curr = t[1];
    sol[curr.pos] = i;
    update(1, max(0, curr.pos - k + 1), min(n - 1, curr.pos + k - 1), 0,
           ofs - 1, -1);
    update(1, curr.pos, curr.pos, 0, ofs - 1, INF);
  }
  for (int i = 0; i < n; i++) {
    cout << sol[i] << endl;
  }
  return 0;
}
