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;
int a[500005], deg[500005], ans[500005], total;
vector<int> g[500005];
struct segment {
  int l, r, v;
} t[500005 << 2];
int read() {
  char c = getchar();
  int x = 0;
  while (!isdigit(c)) c = getchar();
  while (isdigit(c)) {
    x = (x << 3) + (x << 1) + c - '0';
    c = getchar();
  }
  return x;
}
void build(int l = 1, int r = n, int x = 1) {
  t[x].l = l;
  t[x].r = r;
  t[x].v = 0x3f3f3f3f;
  if (l == r) return;
  int mid = (l + r) >> 1;
  build(l, mid, x << 1);
  build(mid + 1, r, x << 1 | 1);
}
void pushup(int x) { t[x].v = min(t[x << 1].v, t[x << 1 | 1].v); }
void modify(int p, int v, int x = 1) {
  if (t[x].l == t[x].r) {
    t[x].v = v;
    return;
  }
  int mid = (t[x].l + t[x].r) >> 1;
  if (p <= mid)
    modify(p, v, x << 1);
  else
    modify(p, v, x << 1 | 1);
  pushup(x);
}
int query(int l, int r, int x = 1) {
  if (l <= t[x].l && t[x].r <= r) return t[x].v;
  int mid = (t[x].l + t[x].r) >> 1, res = 0x3f3f3f3f;
  if (l <= mid) res = min(res, query(l, r, x << 1));
  if (r > mid) res = min(res, query(l, r, x << 1 | 1));
  return res;
}
void construct(int u, int l, int r) {
  int v = query(l, r);
  if (v != 0x3f3f3f3f) {
    g[u].push_back(v);
    ++deg[v];
  }
}
void topsort() {
  priority_queue<int, vector<int>, greater<int> > q;
  for (int i = 1; i <= n; ++i)
    if (!deg[i]) q.push(i);
  while (!q.empty()) {
    int u = q.top();
    ans[u] = ++total;
    q.pop();
    for (int i = 0; i < (int)g[u].size(); ++i) {
      int v = g[u][i];
      if (--deg[v] == 0) q.push(v);
    }
  }
}
int main() {
  n = read();
  k = read();
  build();
  for (int i = 1; i <= n; ++i) a[read()] = i;
  for (int i = n; i >= 1; --i) {
    construct(a[i], max(1, a[i] - k + 1), a[i]);
    construct(a[i], a[i], min(a[i] + k - 1, n));
    modify(a[i], a[i]);
  }
  topsort();
  for (int i = 1; i <= n; ++i) printf("%d\n", ans[i]);
}
