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 ret = 0, f = 0;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = 1;
    c = getchar();
  }
  while (isdigit(c)) {
    ret = ret * 10 + c - 48;
    c = getchar();
  }
  if (f) return -ret;
  return ret;
}
const int N = 5e5 + 10;
const int inf = 0x3f3f3f3f;
int du[N], x[N], p[N], ans[N], top, tot, n, k;
priority_queue<int, vector<int>, greater<int> > q;
int head[N];
struct node {
  int too, Next;
} edge[N * 2];
void add(int a, int b) {
  edge[++top].too = b;
  edge[top].Next = head[a];
  head[a] = top;
}
int mi[N * 4];
void change(int nod, int l, int r, int x, int val) {
  if (l == r) {
    mi[nod] = val;
    return;
  }
  if (x <= (l + r) / 2)
    change(nod * 2, l, (l + r) / 2, x, val);
  else
    change(nod * 2 + 1, (l + r) / 2 + 1, r, x, val);
  mi[nod] = min(mi[nod * 2], mi[nod * 2 + 1]);
}
int query(int nod, int l, int r, int L, int R) {
  if (mi[nod] == inf) return inf;
  if (l == L && r == R) return mi[nod];
  if (R <= (l + r) / 2)
    return query(nod * 2, l, (l + r) / 2, L, R);
  else if (L > (l + r) / 2)
    return query(nod * 2 + 1, (l + r) / 2 + 1, R, L, R);
  else
    return min(query(nod * 2, l, (l + r) / 2, L, (l + r) / 2),
               query(nod * 2 + 1, (l + r) / 2 + 1, r, (l + r) / 2 + 1, R));
}
int main() {
  n = read();
  k = read();
  for (int i = 1; i <= n; i++) p[read()] = i;
  memset(mi, 0x3f, sizeof(mi));
  for (int i = n; i; i--) {
    int x = query(1, 1, n, p[i], min(n, p[i] + k - 1));
    if (x != inf) add(p[i], p[x]), ++du[p[x]];
    x = query(1, 1, n, max(1, p[i] - k + 1), p[i]);
    if (x != inf) add(p[i], p[x]), ++du[p[x]];
    change(1, 1, n, p[i], i);
  }
  for (int i = 1; i <= n; i++)
    if (!du[i]) q.push(i);
  while (!q.empty()) {
    int now = q.top();
    ans[now] = ++tot;
    q.pop();
    for (int i = head[now]; i; i = edge[i].Next) {
      int v = edge[i].too;
      --du[v];
      if (!du[v]) q.push(v);
    }
  }
  for (int i = 1; i <= n; i++) printf("%d\n", ans[i]);
  return 0;
}
