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;
int n, k, p[500010], a[500010];
struct edge {
  int ed, ne;
} e[500010 << 1];
int he[500010], en, in[500010];
int q[500010], len;
int tr[500010 << 2];
int ans[500010], cnt;
int re() {
  int x = 0;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    ;
  for (; isdigit(c); c = getchar()) x = (x << 3) + (x << 1) + c - '0';
  return x;
}
void ins(int a, int b) {
  e[++en].ed = b;
  e[en].ne = he[a];
  he[a] = en;
  ++in[b];
}
int l, r, x;
void modi(int u, int L, int R) {
  if (L == R) {
    tr[u] = L;
    return;
  }
  int mid = L + R >> 1;
  if (l <= mid)
    modi(u << 1, L, mid);
  else
    modi(u << 1 | 1, mid + 1, R);
  if (p[tr[u << 1]] < p[tr[u << 1 | 1]])
    tr[u] = tr[u << 1];
  else
    tr[u] = tr[u << 1 | 1];
}
int ask(int u, int L, int R) {
  if (l <= L && r >= R) return tr[u];
  int mid = L + R >> 1, t = 0, tt;
  if (l <= mid) {
    tt = ask(u << 1, L, mid);
    t = p[tt] < p[t] ? tt : t;
  }
  if (r > mid) {
    tt = ask(u << 1 | 1, mid + 1, R);
    t = p[tt] < p[t] ? tt : t;
  }
  return t;
}
void push(int x) {
  q[++len] = x;
  for (int i = len; i / 2 && q[i] > q[i >> 1]; i >>= 1) swap(q[i], q[i >> 1]);
}
int get() {
  int i, j, t = q[1];
  q[1] = q[len--];
  for (i = 1; i * 2 + 1 <= len; i = j) {
    if (i * 2 + 1 > len || q[i * 2] > q[i * 2 + 1])
      j = i << 1;
    else
      j = i << 1 | 1;
    if (q[i] > q[j]) break;
    swap(q[i], q[j]);
  }
  return t;
}
void bfs() {
  int i, u;
  for (i = 1; i <= n; ++i)
    if (!in[i]) push(i);
  while (len) {
    u = get();
    ans[++cnt] = u;
    for (i = he[u]; i; i = e[i].ne) {
      --in[e[i].ed];
      if (!in[e[i].ed]) push(e[i].ed);
    }
  }
}
int main() {
  int i;
  n = re();
  k = re();
  for (i = 1; i <= n; ++i) a[p[i] = re()] = i;
  p[0] = 1e9;
  for (i = n; i; --i) {
    l = max(1, a[i] - k + 1);
    r = a[i] - 1;
    if (l <= r) {
      x = ask(1, 1, n);
      if (x) ins(x, a[i]);
    }
    l = a[i] + 1;
    r = min(n, a[i] + k - 1);
    if (l <= r) {
      x = ask(1, 1, n);
      if (x) ins(x, a[i]);
    }
    l = a[i];
    modi(1, 1, n);
  }
  bfs();
  for (i = n; i; --i) printf("%d\n", ans[i]);
  return 0;
}
