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 gi() {
  int x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = (x << 3) + (x << 1) + ch - 48;
    ch = getchar();
  }
  return x * f;
}
template <typename T>
inline bool Max(T &a, T b) {
  return a < b ? a = b, 1 : 0;
}
template <typename T>
inline bool Min(T &a, T b) {
  return a > b ? a = b, 1 : 0;
}
const int N = 1e5 + 7;
int n, K;
int pos[N], du[N], ans[N], rans[N];
vector<int> G[N];
void Add(int a, int b) {
  ++du[b];
  G[a].push_back(b);
}
int mx[N << 2];
void modify(int p, int l, int r, int o, int v) {
  if (l == r) {
    mx[o] = v;
    return;
  }
  int mid = l + r >> 1;
  if (p <= mid)
    modify(p, l, mid, o << 1, v);
  else
    modify(p, mid + 1, r, o << 1 | 1, v);
  mx[o] = max(mx[o << 1], mx[o << 1 | 1]);
}
int query(int L, int R, int l, int r, int o) {
  if (L > R) return 0;
  if (L <= l && r <= R) return mx[o];
  int mid = l + r >> 1;
  if (R <= mid) return query(L, R, l, mid, o << 1);
  if (L > mid) return query(L, R, mid + 1, r, o << 1 | 1);
  return max(query(L, R, l, mid, o << 1), query(L, R, mid + 1, r, o << 1 | 1));
}
priority_queue<int> Q;
int main() {
  n = gi(), K = gi() - 1;
  for (int i = 1; i <= n; ++i) {
    pos[gi()] = i;
  }
  for (int i = 1; i <= n; ++i) {
    int x = query(max(1, pos[i] - K), pos[i], 1, n, 1);
    if (x) Add(pos[i], pos[x]);
    x = query(pos[i], min(n, pos[i] + K), 1, n, 1);
    if (x) Add(pos[i], pos[x]);
    modify(pos[i], 1, n, 1, i);
  }
  for (int i = 1; i <= n; ++i)
    if (!du[i]) Q.push(i);
  int now = n;
  while (!Q.empty()) {
    int u = Q.top();
    Q.pop();
    for (auto v : G[u])
      if (--du[v] == 0) Q.push(v);
    ans[now--] = u;
  }
  for (int i = 1; i <= n; ++i) rans[ans[i]] = i;
  for (int i = 1; i <= n; ++i) printf("%d\n", rans[i]);
  return 0;
}
