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 Set {
  static const int N = (5e5) + 10, D = 16, L = N / D + 2;
  bitset<N> vis;
  int lb[1 << D], rb[1 << D], lc[D], rc[D];
  unsigned short val[6][L];
  Set() {
    for (int i = 1; i < 1 << D; ++i) {
      int j = 0;
      while (!(i >> j & 1)) ++j;
      lb[i] = j;
      for (j = D - 1; !(i >> j & 1); --j)
        ;
      rb[i] = j;
    }
    for (int i = 0; i < D; ++i)
      lc[i] = ((1 << D) - 1) >> (D - i),
      rc[i] = ((1 << D) - 1) & (((1 << D) - 1) << (i + 1));
    memset(val, 0, sizeof val);
    vis.reset();
  }
  inline void clear() {
    memset(val, 0, sizeof val);
    vis.reset();
  }
  inline void insert(unsigned int x) {
    if (vis[x]) return;
    vis[x] = 1;
    for (int i = 0; i < 6; ++i, x >>= 4) val[i][x >> 4] |= 1 << (x & 15);
  }
  inline void erase(unsigned int x) {
    if (!vis[x]) return;
    vis[x] = 0;
    for (int i = 0; i < 6; ++i, x >>= 4)
      if (val[i][x >> 4] ^= 1 << (x & 15)) return;
  }
  inline int upper_bound(int x) {
    if (!val[5][0]) return -1;
    int s = val[0][x >> 4] & rc[x & 15];
    if (s) return (x ^ (x & 15)) | lb[s];
    for (int i = 1; i < 6; ++i) {
      x >>= 4;
      s = val[i][x >> 4] & rc[x & 15];
      if (s) {
        x = (x ^ (x & 15)) | lb[s];
        for (int j = i - 1; ~j; --j) x = (x << 4) | lb[val[j][x]];
        return x;
      }
    }
    return -1;
  }
  inline int min() { return upper_bound(0); }
  inline bool empty() { return !val[5][0]; }
} S;
const int N = 500100;
int a[N], b[N], n, K, G[N * 2], ne[N * 2], to[N * 2], xb, d[N];
void add_edge(int x, int y) {
  ne[xb] = G[x];
  to[xb] = y;
  G[x] = xb++;
  ++d[y];
}
int main() {
  cin >> n >> K;
  memset(G, -1, sizeof G);
  for (int i = 1; i <= n; ++i) cin >> a[i], b[a[i]] = i;
  S.clear();
  for (int i = 1; i <= n; ++i) {
    if (i > K) S.erase(a[i - K]);
    int it = S.upper_bound(a[i]);
    if (it != -1) add_edge(i, b[it]);
    S.insert(a[i]);
  }
  S.clear();
  for (int i = n; i; --i) {
    if (i <= n - K) S.erase(a[i + K]);
    int it = S.upper_bound(a[i]);
    if (it != -1) add_edge(i, b[it]);
    S.insert(a[i]);
  }
  S.clear();
  for (int i = 1; i <= n; ++i)
    if (!d[i]) S.insert(i);
  for (; !S.empty();) {
    int x = S.min();
    S.erase(x);
    cout << x << '\n';
    for (int i = G[x]; ~i; i = ne[i]) {
      int u = to[i];
      if (!--d[u]) S.insert(u);
    }
  }
  return 0;
}
