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 INF = 0x3f3f3f3f;
const int MAXN = 100 + 5;
template <typename _T>
void read(_T &x) {
  x = 0;
  char s = getchar();
  int f = 1;
  while (s > '9' || s < '0') {
    if (s == '-') f = -1;
    s = getchar();
  }
  while (s >= '0' && s <= '9') {
    x = (x << 3) + (x << 1) + (s - '0'), s = getchar();
  }
  x *= f;
}
template <typename _T>
void write(_T x) {
  if (x < 0) {
    putchar('-');
    x = (~x) + 1;
  }
  if (9 < x) {
    write(x / 10);
  }
  putchar(x % 10 + '0');
}
template <typename _T>
_T MIN(const _T a, const _T b) {
  return a < b ? a : b;
}
template <typename _T>
_T MAX(const _T a, const _T b) {
  return a > b ? a : b;
}
struct edge {
  int to, nxt;
} Graph[MAXN << 1];
priority_queue<int, vector<int>, greater<int> > q;
int mn[MAXN << 2];
int seq[MAXN], ans[MAXN];
int A[MAXN], P[MAXN], head[MAXN], deg[MAXN];
int N, K, cnt;
void addEdge(const int from, const int to) {
  Graph[++cnt].to = to, Graph[cnt].nxt = head[from];
  head[from] = cnt, deg[to]++;
}
void upt(const int x) { mn[x] = MIN(mn[x << 1], mn[x << 1 | 1]); }
void build(const int x, const int l, const int r) {
  if (l > r) return;
  mn[x] = INF;
  if (l == r) return;
  int mid = l + r >> 1;
  build(x << 1, l, mid);
  build(x << 1 | 1, mid + 1, r);
}
void update(const int x, const int l, const int r, const int p, const int v) {
  if (l == r) {
    mn[x] = v;
    return;
  }
  int mid = l + r >> 1;
  if (p <= mid)
    update(x << 1, l, mid, p, v);
  else
    update(x << 1 | 1, mid + 1, r, p, v);
  upt(x);
}
int query(const int x, const int l, const int r, const int segL,
          const int segR) {
  if (segL <= l && r <= segR) return mn[x];
  int mid = l + r >> 1, ret = INF;
  if (segL <= mid) ret = MIN(ret, query(x << 1, l, mid, segL, segR));
  if (mid < segR) ret = MIN(ret, query(x << 1 | 1, mid + 1, r, segL, segR));
  return ret;
}
int query(const int l, const int r) {
  return query(1, 1, N, MAX(1, l), MIN(N, r));
}
int main() {
  read(N), read(K);
  for (int i = 1; i <= N; i++) read(P[i]), A[P[i]] = i;
  build(1, 1, N);
  for (int i = N; i; i--) {
    int pre = query(A[i] - K + 1, A[i]), nxt = query(A[i], A[i] + K - 1);
    if (pre < INF) addEdge(A[i], A[pre]);
    if (nxt < INF) addEdge(A[i], A[nxt]);
    update(1, 1, N, A[i], i);
  }
  for (int i = 1; i <= N; i++)
    if (!deg[i]) q.push(i);
  int u, v, tot = 0;
  while (!q.empty()) {
    u = seq[++tot] = q.top(), q.pop();
    for (int i = head[u]; i; i = Graph[i].nxt)
      if (!(--deg[v = Graph[i].to])) q.push(v);
  }
  for (int i = 1; i <= N; i++) ans[seq[i]] = i;
  for (int i = 1; i <= N; i++) write(ans[i]), putchar('\n');
  return 0;
}
