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 = 300005;
const int P = 1e9 + 7;
const int inf = 1e9;
const long long Inf = 1e15;
inline int IN() {
  char ch = getchar();
  int x = 0, f = 0;
  while (ch < '0' || ch > '9') ch = getchar(), f = (ch == '-');
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + ch - 48;
    ch = getchar();
  }
  return f ? (-x) : x;
}
inline int Pow(int x, int y, int p) {
  int an = 1;
  for (; y; y >>= 1, x = (long long)x * x % p)
    if (y & 1) an = (long long)an * x % p;
  return an;
}
void renew(int &x, int y) {
  x += y;
  if (x < 0)
    x += P;
  else if (x >= P)
    x -= P;
}
template <typename T>
inline void chkmin(T &a, const T &b) {
  if (a > b) a = b;
}
template <typename T>
inline void chkmax(T &a, const T &b) {
  if (a < b) a = b;
}
int deg[N];
int n, k, a[N], b[N];
vector<int> e[N];
struct seg {
  int sum[N << 2];
  int ql, qr, qx, qv;
  void M(int x, int L, int R) {
    if (L == R) {
      sum[x] = 1;
      return;
    }
    if (qx <= (((L) + (R)) >> 1))
      M(((x) << 1), L, (((L) + (R)) >> 1));
    else
      M(((((x) << 1)) | 1), (((L) + (R)) >> 1) + 1, R);
    sum[x] = sum[((x) << 1)] + sum[((((x) << 1)) | 1)];
  }
  void D(int x, int L, int R) {
    if (!sum[x]) return;
    if (L == R) {
      e[L].push_back(qv);
      deg[qv]++;
      sum[x] = 0;
      return;
    }
    if (ql <= L && R <= qr) {
      D(((x) << 1), L, (((L) + (R)) >> 1));
      D(((((x) << 1)) | 1), (((L) + (R)) >> 1) + 1, R);
      return;
    }
    if (ql <= (((L) + (R)) >> 1)) D(((x) << 1), L, (((L) + (R)) >> 1));
    if ((((L) + (R)) >> 1) < qr)
      D(((((x) << 1)) | 1), (((L) + (R)) >> 1) + 1, R);
    sum[x] = sum[((x) << 1)] + sum[((((x) << 1)) | 1)];
  }
  void Modify(int x) {
    qx = x;
    M(1, 1, n);
  }
  void Delete(int L, int R, int v) {
    if (L > R) return;
    ql = L;
    qr = R;
    qv = v;
    D(1, 1, n);
  }
} L, R;
set<int> fres;
int lab[N], tim;
int main() {
  scanf("%d%d", &n, &k);
  for (int i = (int)1; i <= (int)n; i++) scanf("%d", a + i);
  for (int i = (int)1; i <= (int)n; i++) b[a[i]] = i;
  for (int i = (int)1; i <= (int)n; i++) {
    int x = b[i];
    L.Delete(max(1, x - k + 1), x - 1, x);
    R.Delete(x + 1, min(n, x + k - 1), x);
    L.Modify(x);
    R.Modify(x);
  }
  for (int i = (int)1; i <= (int)n; i++)
    if (!deg[i]) fres.insert(i);
  while (!fres.empty()) {
    int x = *fres.begin();
    lab[x] = ++tim;
    fres.erase(x);
    for (int v : e[x]) {
      --deg[v];
      if (!deg[v]) fres.insert(v);
    }
  }
  for (int i = (int)1; i <= (int)n; i++) printf("%d\n", lab[i]);
  return 0;
}
