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 N = 5e5 + 5, INF = 1e9;
int n, k, wh, mode, i, a[N], p[N], deg[N], out[N];
int Min[N * 4], cs[N * 4], dec[N * 4];
int sum[N];
template <typename T>
void read(T &ret) {
  char ch;
  ret = 0;
  for (ch = getchar(); ch < '0' || ch > '9'; ch = getchar())
    ;
  for (; ch >= '0' && ch <= '9'; ch = getchar()) ret = ret * 10 + ch - '0';
}
int lowbit(int x) { return x & (-x); }
void add(int x) {
  while (x <= n) {
    sum[x]++;
    x += lowbit(x);
  }
}
int query(int x) {
  if (x < 1) return 0;
  if (x > n) x = n;
  int ret = 0;
  while (x > 0) {
    ret += sum[x];
    x -= lowbit(x);
  }
  return ret;
}
void merge(int x) {
  Min[x] = min(Min[(x << 1)], Min[((x << 1) | 1)]);
  cs[x] = min(cs[(x << 1)], cs[((x << 1) | 1)]);
}
void build(int x, int l, int r) {
  if (l == r) {
    if (!deg[l]) {
      Min[x] = INF;
      cs[x] = l;
    } else
      Min[x] = deg[l], cs[x] = INF;
    return;
  }
  int mid = (l + r) >> 1;
  build((x << 1), l, mid);
  build(((x << 1) | 1), mid + 1, r);
  merge(x);
}
void Init() {
  freopen("permutation.in", "r", stdin);
  freopen("permutation.out", "w", stdout);
  read(n);
  read(k);
  for (i = 1; i <= n; i++) read(a[i]), p[a[i]] = i;
  for (i = 1; i <= n; i++) {
    deg[p[i]] = query(p[i] + k - 1) - query(p[i] - k);
    add(p[i]);
  }
  build(1, 1, n);
}
void pushdown(int x) {
  Min[(x << 1)] -= dec[x];
  dec[(x << 1)] += dec[x];
  Min[((x << 1) | 1)] -= dec[x];
  dec[((x << 1) | 1)] += dec[x];
  dec[x] = 0;
}
void recalc(int x, int l, int r) {
  if (l == r) {
    if (Min[x] < 1) {
      Min[x] = INF;
      cs[x] = l;
    }
    return;
  }
  int mid = (l + r) >> 1;
  pushdown(x);
  if (Min[(x << 1)] < 1) recalc((x << 1), l, mid);
  if (Min[((x << 1) | 1)] < 1) recalc(((x << 1) | 1), mid + 1, r);
  merge(x);
}
void modify(int x, int L, int R, int l, int r) {
  if (l > R || r < L) {
    if (Min[x] < 1) recalc(x, l, r);
    return;
  }
  if (L <= l && r <= R) {
    if (mode == 1)
      cs[x] = INF;
    else {
      Min[x]--;
      dec[x]++;
    }
    if (Min[x] < 1) recalc(x, l, r);
    return;
  }
  int mid = (l + r) >> 1;
  pushdown(x);
  modify((x << 1), L, R, l, mid);
  modify(((x << 1) | 1), L, R, mid + 1, r);
  merge(x);
}
void Solve() {
  int L, R;
  for (i = 1; i <= n; i++) {
    wh = cs[1];
    out[wh] = i;
    mode = 1;
    modify(1, wh, wh, 1, n);
    mode = 2;
    L = max(1, wh - k + 1);
    R = min(n, wh + k - 1);
    modify(1, L, R, 1, n);
  }
}
void Outit() {
  for (i = 1; i <= n; i++) printf("%d\n", out[i]);
}
int main() {
  Init();
  Solve();
  Outit();
  return 0;
}
