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 N = 5e5 + 123;
const long long mod = 1e9 + 7;
int n, k, f[N], b[N], Aybar_gde_F[N];
pair<int, int> a[N];
void fupd(int v, int val) {
  for (; v <= n; v = (v | (v + 1))) f[v] += val;
}
int fget(int v) {
  int val = 0;
  for (; v >= 0; v = (v & (v + 1)) - 1) val += f[v];
  return val;
}
struct node {
  int val = 0, tt = 0;
} t[N * 4];
void build(int v, int tl, int tr) {
  if (tl == tr) {
    t[v].val = b[tl];
    return;
  }
  int tm = (tl + tr) / 2;
  build(v * 2, tl, tm);
  build(v * 2 + 1, tm + 1, tr);
  if (t[v * 2].val < t[v * 2 + 1].val) {
    t[v] = t[v * 2];
  } else {
    t[v] = t[v * 2 + 1];
  }
}
void push(int v) {
  if (t[v].tt == 0) {
    return;
  }
  t[v * 2].val = max(0, t[v].tt + t[v * 2].val);
  t[v * 2 + 1].val = max(0, t[v].tt + t[v * 2 + 1].val);
  t[v * 2].tt += t[v].tt;
  t[v * 2 + 1].tt += t[v].tt;
  t[v].tt = 0;
}
void upd(int v, int tl, int tr, int l, int r, int val) {
  if (tl > r || l > tr) {
    return;
  }
  if (tl >= l && tr <= r) {
    t[v].val = max(0, val + t[v].val);
    t[v].tt += val;
    return;
  }
  push(v);
  int tm = (tl + tr) / 2;
  upd(v * 2, tl, tm, l, r, val);
  upd(v * 2 + 1, tm + 1, tr, l, r, val);
  if (t[v * 2].val < t[v * 2 + 1].val) {
    t[v].val = t[v * 2].val;
  } else {
    t[v].val = t[v * 2 + 1].val;
  }
}
int get_solve(int v, int tl, int tr) {
  if (tl == tr) {
    return tl;
  }
  push(v);
  int tm = (tl + tr) / 2;
  if (t[v * 2].val < t[v * 2 + 1].val) {
    return get_solve(v * 2, tl, tm);
  } else {
    return get_solve(v * 2 + 1, tm + 1, tr);
  }
}
void debug(int v, int tl, int tr) {
  if (tl == tr) return;
  push(v);
  int tm = (tl + tr) / 2;
  debug(v * 2, tl, tm);
  debug(v * 2 + 1, tm + 1, tr);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].first;
    a[i].first *= -1;
    a[i].second = i;
  }
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) {
    int pos = a[i].second;
    b[pos] = fget(min(n, pos + k - 1)) - fget(max(0, pos - k));
    fupd(pos, 1);
  }
  build(1, 1, n);
  for (int i = n; i >= 1; i--) {
    int pos = get_solve(1, 1, n);
    Aybar_gde_F[i] = pos;
    upd(1, 1, n, max(1, pos - k + 1), min(n, pos + k - 1), -1);
    upd(1, 1, n, pos, pos, N);
  }
  for (int i = 1; i <= n; i++) cout << Aybar_gde_F[i] << "\n";
  return 0;
}
