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>
const int BUFFER_SIZE = 1 << 25 | 1;
struct InputOutputStream {
  char ibuf[BUFFER_SIZE], obuf[BUFFER_SIZE], *s, *oh;
  InputOutputStream() : s(ibuf), oh(obuf) {
    ibuf[fread(ibuf, 1, BUFFER_SIZE, stdin)] = '\0';
  }
  ~InputOutputStream() { fwrite(obuf, 1, oh - obuf, stdout); }
  template <typename T>
  inline InputOutputStream &operator>>(T &x) {
    while (!isdigit(*s)) ++s;
    for (x = 0; isdigit(*s); ++s) x = x * 10 + (*s ^ '0');
    return *this;
  }
  template <typename T>
  inline InputOutputStream &operator<<(T x) {
    static char buf[23];
    register char *top = buf;
    if (x) {
      for (T t; x;) t = x / 10, *top++ = x - t * 10 + 48, x = t;
      while (top != buf) *oh++ = *--top;
    } else
      *oh++ = '0';
    *oh++ = '\n';
    return *this;
  }
} IO;
template <typename lhs, typename rhs>
inline lhs min(const lhs &x, const rhs &y) {
  return x < y ? x : y;
}
template <typename lhs, typename rhs>
inline lhs max(const lhs &x, const rhs &y) {
  return x > y ? x : y;
}
const int MAXN = 500003;
int n, k, p[MAXN], q[MAXN];
const int MAXT = 2000003;
struct SegmentTree {
  int mx[MAXT];
  void modify(int k, int l, int r, int x, int v) {
    mx[k] = max(mx[k], v);
    if (l == r) return;
    x <= ((l + r) >> 1) ? modify((k << 1), l, ((l + r) >> 1), x, v)
                        : modify((k << 1 | 1), ((l + r) >> 1) + 1, r, x, v);
  }
  int query(int k, int l, int r, int x, int y) {
    if (x <= l && r <= y) return mx[k];
    int o = 0;
    if (x <= ((l + r) >> 1))
      o = max(o, query((k << 1), l, ((l + r) >> 1), x, y));
    if (((l + r) >> 1) < y)
      o = max(o, query((k << 1 | 1), ((l + r) >> 1) + 1, r, x, y));
    return o;
  }
} tree;
std::vector<int> g[MAXN];
int deg[MAXN];
std::priority_queue<int> que;
int main() {
  IO >> n >> k, --k;
  for (int i = 1; i <= n; ++i) IO >> p[i], q[p[i]] = i;
  for (int i = 1; i <= n; ++i) {
    int temp = tree.query(1, 1, n, q[i] - k, q[i]);
    if (temp) g[q[i]].push_back(temp), ++deg[temp];
    temp = tree.query(1, 1, n, q[i], q[i] + k);
    if (temp) g[q[i]].push_back(temp), ++deg[temp];
    tree.modify(1, 1, n, q[i], q[i]);
  }
  static int ans[MAXN], cnt = 0;
  for (int i = 1; i <= n; ++i)
    if (!deg[i]) que.push(i);
  while (!que.empty()) {
    int x = que.top();
    que.pop(), ans[++cnt] = x;
    for (int y : g[x])
      if (--deg[y] == 0) que.push(y);
  }
  std::reverse(ans + 1, ans + n + 1);
  for (int i = 1; i <= n; ++i) p[ans[i]] = i;
  for (int i = 1; i <= n; ++i) IO << p[i];
  return 0;
}
