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;
const int maxn = 5e5 + 10;
const int inf = 0x3f3f3f3f;
int n, K;
int a[maxn], b[maxn], c[maxn];
vector<int> G[maxn];
struct Segment_tree {
  int Max[maxn << 2];
  inline void pushup(int node) {
    Max[node] = max(Max[node << 1], Max[node << 1 | 1]);
  }
  void update(int node, int l, int r, int pos, int x) {
    if (l == r) {
      Max[node] = x;
      return;
    }
    if (pos <= ((l + r) >> 1))
      update(node << 1, l, ((l + r) >> 1), pos, x);
    else
      update(node << 1 | 1, ((l + r) >> 1) + 1, r, pos, x);
    pushup(node);
  }
  int query(int node, int l, int r, int s, int t) {
    if (s <= l && r <= t) return Max[node];
    int res = 0;
    if (s <= ((l + r) >> 1))
      res = max(res, query(node << 1, l, ((l + r) >> 1), s, t));
    if (((l + r) >> 1) < t)
      res = max(res, query(node << 1 | 1, ((l + r) >> 1) + 1, r, s, t));
    return res;
  }
} T;
template <class T>
void read(T &x) {
  x = 0;
  char c = getchar();
  while (!isdigit(c)) c = getchar();
  while (isdigit(c)) x = (x << 1) + (x << 3) + (c ^ 48), c = getchar();
}
void dfs(int node) {
  static int tot = 0;
  sort(G[node].begin(), G[node].end());
  if (node) c[++tot] = node;
  for (int i = (0); i <= (int)(G[node].size() - 1); ++i) {
    int u = G[node][i];
    dfs(u);
  }
}
int main() {
  read(n), read(K);
  for (int i = (1); i <= (int)(n); ++i) read(a[i]), b[a[i]] = i;
  for (int i = (1); i <= (int)(n); ++i) {
    int pos = T.query(1, 1, n, b[i] + 1, b[i] + K - 1);
    T.update(1, 1, n, b[i], i);
    G[b[pos]].push_back(b[i]);
  }
  dfs(0);
  static int ans[maxn];
  for (int i = (1); i <= (int)(n); ++i) ans[c[i]] = i;
  for (int i = (1); i <= (int)(n); ++i) printf("%d\n", ans[i]);
  return 0;
}
