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;
struct node {
  int l, r, data, miner;
};
struct note {
  int v, next;
};
node tree[5000001];
note edge[5000001];
long long a[5000001], p[5000001], s1, s2, ans[5000001], res[5000001],
    head[5000001], len, in[5000001], n, length;
priority_queue<int> q;
void add(int x, int y) {
  edge[++len].v = y;
  edge[len].next = head[x];
  head[x] = len;
  in[y]++;
  return;
}
void build(int k, int l, int r) {
  tree[k].l = l;
  tree[k].r = r;
  tree[k].data = 1e9;
  if (l == r) return;
  int mid = (l + r) / 2;
  build(k * 2, l, mid);
  build(k * 2 + 1, mid + 1, r);
  return;
}
void adder(int k, int x, int d) {
  if (tree[k].l == tree[k].r) {
    tree[k].data = d;
    return;
  }
  int mid = (tree[k].l + tree[k].r) / 2;
  if (x <= mid)
    adder(k * 2, x, d);
  else
    adder(k * 2 + 1, x, d);
  tree[k].data = min(tree[k * 2].data, tree[k * 2 + 1].data);
  return;
}
int query(int k, int l, int r) {
  if (l > r) return 1e9;
  if (tree[k].l == l && tree[k].r == r) return tree[k].data;
  int mid = (tree[k].l + tree[k].r) / 2;
  if (l <= mid && r <= mid) return query(k * 2, l, r);
  if (l >= mid + 1 && r >= mid + 1) return query(k * 2 + 1, l, r);
  return min(query(k * 2, l, mid), query(k * 2 + 1, mid + 1, r));
}
void top_sort() {
  int top;
  for (int i = 1; i <= n; ++i)
    if (in[i] == 0) q.push(-i);
  while (!q.empty()) {
    top = -q.top();
    q.pop();
    ans[top] = ++length;
    for (int i = head[top]; i > 0; i = edge[i].next) {
      in[edge[i].v]--;
      if (in[edge[i].v] == 0) q.push(-edge[i].v);
    }
  }
  return;
}
int main() {
  int k;
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    p[a[i]] = i;
  }
  build(1, 1, n);
  for (int i = n; i >= 1; --i) {
    s1 = query(1, max(p[i] - k + 1, 1ll), p[i] - 1);
    if (s1 != 1e9) add(p[i], p[s1]);
    s2 = query(1, p[i] + 1, min(p[i] + k - 1, n));
    if (s2 != 1e9) add(p[i], p[s2]);
    adder(1, p[i], i);
  }
  top_sort();
  for (int i = 1; i <= n; ++i) printf("%d\n", ans[i]);
  return 0;
}
