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[500010];
int t[500010];
void file() {
  freopen("permutation.in", "r", stdin);
  freopen("permutation.out", "w", stdout);
}
int tr[500010 << 2];
struct node {
  int v, nxt;
} e[500010];
int head[500010], cnt;
void add(int u, int v) {
  e[++cnt].v = v;
  e[cnt].nxt = head[u];
  head[u] = cnt;
}
int in[500010];
void pushup(int u) { tr[u] = max(tr[u << 1], tr[u << 1 | 1]); }
void insert(int u, int l, int r, int val, int pos) {
  if (l == r) {
    tr[u] = val;
    return;
  }
  int mid = (l + r) >> 1;
  if (pos <= mid)
    insert(u << 1, l, mid, val, pos);
  else
    insert(u << 1 | 1, mid + 1, r, val, pos);
  pushup(u);
}
int query(int u, int l, int r, int ql, int qr) {
  if (l == r) return tr[u];
  int mid = (l + r) >> 1;
  int res = 0;
  if (ql <= mid) res = max(res, query(u << 1, l, mid, ql, qr));
  if (qr > mid) res = max(res, query(u << 1 | 1, mid + 1, r, ql, qr));
  return res;
}
priority_queue<int> q;
int ans[500010];
void gettop() {
  for (int i = 1; i <= n; i++)
    if (in[i] == 0) q.push(i);
  for (int i = n; i >= 1; i--) {
    if (q.empty()) return;
    int u = q.top();
    q.pop();
    ans[i] = u;
    for (int j = head[u]; j; j = e[j].nxt) {
      int v = e[j].v;
      in[v]--;
      if (in[v] == 0) q.push(v);
    }
  }
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    t[a[i]] = i;
  }
  for (int i = 1; i <= n; i++) {
    int pos = query(1, 1, n, t[i] + 1, t[i] + k - 1);
    insert(1, 1, n, i, t[i]);
    add(t[pos], t[i]);
    if (pos != 0 && t[pos] != 0) in[t[i]]++;
  }
  gettop();
  for (int i = 1; i <= n; i++) {
    a[ans[i]] = i;
  }
  for (int i = 1; i <= n; i++) printf("%d\n", a[i]);
  return 0;
}
