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;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) f = ch == '-' ? -1 : f, ch = getchar();
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  return x * f;
}
int buf[30];
inline void write(int x) {
  if (x < 0) putchar('-'), x = -x;
  for (; x; x /= 10) buf[++buf[0]] = x % 10;
  if (!buf[0]) buf[++buf[0]] = 0;
  for (; buf[0]; putchar('0' + buf[buf[0]--]))
    ;
}
const int N = 500005;
const int LGN = 20;
const int S = N * LGN;
const int E = S * 3;
int a[N], p[N], ans[N], pos[N], root[N];
int tov[E], nxt[E];
int deg[S], last[S];
set<int> heap;
queue<int> q;
int n, K, tot;
inline void insert(int x, int y) {
  tov[++tot] = y, nxt[tot] = last[x], last[x] = tot, ++deg[y];
}
struct segment_tree {
  int son[S][2];
  int tot;
  void addpoint(int &rt, int rt_, int x, int l, int r) {
    rt = l == r ? x : ++tot, son[rt][0] = son[rt_][0], son[rt][1] = son[rt_][1];
    if (l == r) return;
    int mid = l + r >> 1;
    if (x <= mid)
      addpoint(son[rt][0], son[rt_][0], x, l, mid);
    else
      addpoint(son[rt][1], son[rt_][1], x, mid + 1, r);
    insert(rt, son[rt][0]), insert(rt, son[rt][1]);
  }
  void addedge(int rt, int st, int en, int l, int r, int id) {
    if (st == l && en == r) {
      insert(id, rt);
      return;
    }
    int mid = l + r >> 1;
    if (en <= mid)
      addedge(son[rt][0], st, en, l, mid, id);
    else if (mid + 1 <= st)
      addedge(son[rt][1], st, en, mid + 1, r, id);
    else
      addedge(son[rt][0], st, mid, l, mid, id),
          addedge(son[rt][1], mid + 1, en, mid + 1, r, id);
  }
} t;
void solve() {
  root[n + 1] = 0, t.tot = n;
  for (int i = n; i >= 1; --i)
    t.addpoint(root[i], root[i + 1], a[i], 1, n),
        t.addedge(root[i + 1], max(a[i] - K + 1, 1), min(a[i] + K - 1, n), 1, n,
                  a[i]);
  for (int i = 1; i <= n; ++i)
    if (!deg[i]) heap.insert(i);
  for (int i = n + 1; i <= t.tot; ++i)
    if (!deg[i]) q.push(i);
  for (int x, i, y, id = 0; !heap.empty() || !q.empty();)
    if (q.empty()) {
      pos[++id] = x = *heap.begin(), heap.erase(heap.begin());
      for (i = last[x]; i; i = nxt[i])
        if (!--deg[y = tov[i]])
          if (y <= n)
            heap.insert(y);
          else
            q.push(y);
    } else {
      x = q.front(), q.pop();
      for (i = last[x]; i; i = nxt[i])
        if (!--deg[y = tov[i]])
          if (y <= n)
            heap.insert(y);
          else
            q.push(y);
    }
}
int main() {
  n = read(), K = read();
  for (int i = 1; i <= n; ++i) a[p[i] = read()] = i;
  solve();
  for (int i = 1; i <= n; ++i) ans[pos[i]] = i;
  for (int i = 1; i <= n; ++i) write(ans[i]), putchar('\n');
  return 0;
}
