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>
#pragma warning(disable : 4996)
using namespace std;
const int maxn = 200005;
const long long mod = 998244353;
const double PI = acos(-1.0);
int a[524288], b[524288], ch[524288], out[524288];
vector<int> par[524288];
int dat[524288 * 2 + 10];
int inf = 1145141919;
priority_queue<int> q;
int query(int a, int b, int k = 0, int l = 0, int r = 524288) {
  if (r <= a || b <= l) {
    return inf;
  }
  if (a <= l && r <= b) {
    return dat[k];
  }
  int vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
  int vr = query(a, b, k * 2 + 2, (l + r) / 2, r);
  return min(vl, vr);
}
void update(int k, int a) {
  k += 524288 - 1;
  dat[k] = a;
  while (k > 0) {
    k = (k - 1) / 2;
    dat[k] = min(dat[k * 2 + 1], dat[k * 2 + 2]);
  }
  return;
}
void solve() {
  int n, k;
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    a[i]--;
  }
  for (int i = 0; i < n; i++) {
    b[a[i]] = i;
  }
  for (int i = 0; i < 524288 * 2 + 10; i++) {
    dat[i] = inf;
  }
  for (int i = 0; i < n; i++) {
    int x = query(b[i], min(n, b[i] + k));
    if (x < inf) {
      ch[b[-x]]++, par[b[i]].push_back(b[-x]);
    }
    update(b[i], -i);
  }
  for (int i = 0; i < 524288 * 2 + 10; i++) {
    dat[i] = inf;
  }
  for (int i = 0; i <= n - 1; i++) {
    int x = query(max(0, b[i] - k + 1), b[i]);
    if (x < inf) {
      ch[b[i]]++, par[b[x]].push_back(b[i]);
    }
    update(b[i], i);
  }
  for (int i = 0; i < n; i++) {
    if (ch[i] == 0) {
      q.push(i);
    }
  }
  for (int i = 0; i < n; i++) {
    int p = q.top();
    q.pop();
    out[p] = n - i - 1;
    for (int j = 0; j < par[p].size(); j++) {
      ch[par[p][j]]--;
      if (ch[par[p][j]] < 1) {
        q.push(par[p][j]);
      }
    }
  }
  for (int i = 0; i < n; i++) {
    printf("%d\n", out[i] + 1);
  }
}
int main() {
  solve();
  return 0;
}
