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 long long read() {
  char ch = getchar();
  long long s = 0, w = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    s = s * 10 + ch - '0';
    ch = getchar();
  }
  return s * w;
}
int maxn[500010 << 2];
int n, k;
int p[500010], ans[500010], vis[500010];
priority_queue<int, vector<int>, less<int> > Q;
inline void pushup(int x) {
  maxn[x] =
      p[maxn[x << 1]] > p[maxn[x << 1 | 1]] ? maxn[x << 1] : maxn[x << 1 | 1];
}
void build(int l, int r, int x) {
  if (l == r) {
    maxn[x] = l;
    return;
  }
  int mid = (l + r) >> 1;
  build(l, mid, x << 1);
  build(mid + 1, r, x << 1 | 1);
  pushup(x);
}
void update(int l, int r, int pos, int x) {
  if (l == r) {
    maxn[x] = 0;
    return;
  }
  int mid = (l + r) >> 1;
  if (pos <= mid)
    update(l, mid, pos, x << 1);
  else
    update(mid + 1, r, pos, x << 1 | 1);
  pushup(x);
}
int query(int l, int r, int x, int left, int right) {
  left = max(left, 1);
  right = min(right, n);
  if (left > right) return 0;
  if (l == left && right == r) return maxn[x];
  int mid = (l + r) >> 1;
  if (right <= mid)
    return query(l, mid, x << 1, left, right);
  else if (left > mid)
    return query(mid + 1, r, x << 1 | 1, left, right);
  else {
    int ls = query(l, mid, x << 1, left, mid),
        rs = query(mid + 1, r, x << 1 | 1, mid + 1, right);
    return p[ls] > p[rs] ? ls : rs;
  }
}
inline int check(int x) {
  if (vis[x]) return 0;
  return query(1, n, 1, x - k + 1, x + k - 1) == x;
}
int main() {
  n = read(), k = read();
  for (register int i = 1; i <= n; i++) p[i] = read();
  build(1, n, 1);
  for (register int i = 1; i <= n; i++)
    if (check(i)) Q.push(i);
  for (register int i = n; i >= 1; i--) {
    int x = Q.top();
    Q.pop();
    ans[i] = x;
    int y;
    update(1, n, x, 1);
    if (check(y = query(1, n, 1, x - k + 1, x - 1))) Q.push(y);
    if (check(y = query(1, n, 1, x + 1, x + k - 1))) Q.push(y);
  }
  for (register int i = 1; i <= n; i++) printf("%d\n", ans[i]);
  return 0;
}
