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>
namespace IO {
template <typename T>
inline void read(T &x) {
  x = 0;
  int f = 1;
  char ch = getchar();
  while (ch > '9' || ch < '0') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    x = (x << 3) + (x << 1) + ch - '0', ch = getchar();
  x *= f;
  return;
}
template <typename T>
inline void write(T x = 0) {
  T wr[51];
  wr[0] = 0;
  if (x < 0) putchar('-'), x = -x;
  if (!x) putchar(48);
  while (x) wr[++wr[0]] = x % 10, x /= 10;
  while (wr[0]) putchar(48 + wr[wr[0]--]);
  return;
}
}  // namespace IO
using IO::read;
using namespace std;
const int N = 2e6 + 11;
int n, k, tot, x;
int p[N], q[N], mx[N];
set<pair<int, int> > s;
set<pair<int, int> >::iterator it;
priority_queue<pair<int, int> > heap;
int nxt[N], las[N], to[N], deg[N];
inline void add(int x, int y) {
  nxt[++tot] = las[x];
  las[x] = tot;
  to[tot] = y;
  ++deg[y];
}
inline void topsort() {
  for (register int i = 1; i <= n; ++i)
    if (!deg[i]) heap.push(make_pair(-q[i], i));
  while (!heap.empty()) {
    int x = heap.top().second, y = -heap.top().first;
    heap.pop();
    printf("%d\n", y);
    for (register int e = las[x]; e; e = nxt[e]) {
      --deg[to[e]];
      if (!deg[to[e]]) heap.push(make_pair(-q[to[e]], to[e]));
    }
  }
}
inline void ins(int x, int p, int k = 1, int l = 1, int r = n) {
  if (l == r) {
    mx[k] = p;
    return;
  }
  int mid = (l + r) >> 1;
  x <= mid ? ins(x, p, k << 1, l, mid) : ins(x, p, k << 1 | 1, mid + 1, r);
  mx[k] = max(mx[k << 1], mx[k << 1 | 1]);
}
inline int query(int x, int y, int k = 1, int l = 1, int r = n) {
  if (x <= l && r <= y) return mx[k];
  int mid = (l + r) >> 1;
  int ans = 0;
  if (x <= mid) ans = query(x, y, k << 1, l, mid);
  if (mid < y) ans = max(ans, query(x, y, k << 1 | 1, mid + 1, r));
  return ans;
}
int main() {
  read(n), read(k);
  for (register int i = 1; i <= n; ++i) {
    read(p[i]);
    q[p[i]] = i;
  }
  for (register int i = 1; i <= n; ++i) {
    x = query(q[i], min(q[i] + k - 1, n));
    if (x) add(x, i);
    x = query(max(q[i] - k + 1, 1), q[i]);
    if (x) add(x, i);
    ins(q[i], i);
  }
  topsort();
  return 0;
}
