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, num, k, cnt;
int p[500010], a[500010], dig[500010], ans[500010], head[500010],
    val[500010 << 2];
struct edge {
  int next, to;
} e[500010 << 1];
void add(int from, int to) {
  e[++num] = (edge){head[from], to};
  head[from] = num;
}
priority_queue<int, vector<int>, greater<int> > Q;
void build(int node, int l, int r) {
  val[node] = 1e9;
  if (l == r) return;
  int mid = (l + r) >> 1;
  build(node << 1, l, mid);
  build(node << 1 | 1, mid + 1, r);
}
void change(int node, int l, int r, int p, int v) {
  val[node] = min(val[node], v);
  if (l == r) return;
  int mid = (l + r) >> 1;
  if (p <= mid)
    change(node << 1, l, mid, p, v);
  else
    change(node << 1 | 1, mid + 1, r, p, v);
}
int query(int node, int l, int r, int l1, int r1) {
  if (l1 > r1) return 1e9;
  if (l1 <= l && r1 >= r) return val[node];
  int mid = (l + r) >> 1, ans = 1e9;
  if (l1 <= mid) ans = min(ans, query(node << 1, l, mid, l1, r1));
  if (r1 > mid) ans = min(ans, query(node << 1 | 1, mid + 1, r, l1, r1));
  return ans;
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &p[i]);
  for (int i = 1; i <= n; i++) a[p[i]] = i;
  build(1, 1, n);
  for (int i = n; i >= 1; i--) {
    int res;
    res = query(1, 1, n, max(1, a[i] - k + 1), a[i] - 1);
    if (res != 1e9) add(a[i], a[res]), dig[a[res]]++;
    res = query(1, 1, n, a[i] + 1, min(a[i] + k - 1, n));
    if (res != 1e9) add(a[i], a[res]), dig[a[res]]++;
    change(1, 1, n, a[i], i);
  }
  for (int i = 1; i <= n; i++)
    if (!dig[i]) Q.push(i);
  while (!Q.empty()) {
    int x = Q.top();
    Q.pop();
    ans[++cnt] = x;
    for (int i = head[x]; i; i = e[i].next) {
      int to = e[i].to;
      if ((--dig[to]) == 0) Q.push(to);
    }
  }
  for (int i = 1; i <= cnt; i++) printf("%d\n", ans[i]);
  return 0;
}
