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>
const int N = 500000 + 10;
using namespace std;
int n, m, e;
int mx[N << 2], t[N], s[N], b[N], bgn[N << 1], to[N << 2], nxt[N << 2];
int v[N], snt;
priority_queue<int, vector<int>, greater<int> > q;
namespace seg {
inline int ckmx(int a, int b) { return a > b ? a : b; }
void mt(int x) { mx[x] = ckmx(mx[(x << 1)], mx[(x << 1) | 1]); }
void upd(int x, int l, int r, int p, int v) {
  if (l == r) {
    mx[x] = v;
    return;
  }
  int m = (l + r) >> 1;
  if (p <= m)
    upd((x << 1), l, m, p, v);
  else
    upd((x << 1) | 1, m + 1, r, p, v);
  mt(x);
}
int qury(int x, int l, int r, int ql, int qr) {
  if (ql <= l && r <= qr)
    return mx[x];
  else {
    int g = 0, m = (l + r) >> 1;
    if (ql <= m) g = ckmx(g, qury((x << 1), l, m, ql, qr));
    if (m < qr) g = ckmx(g, qury((x << 1) | 1, m + 1, r, ql, qr));
    return g;
  }
}
}  // namespace seg
using namespace seg;
namespace solver {
int abs(int x) { return x > 0 ? x : -x; }
void add(int x, int y) {
  to[++e] = y;
  nxt[e] = bgn[x];
  bgn[x] = e;
}
void dfs(int x = 0) {
  int sz = 0;
  s[snt++] = x;
  for (int i = bgn[x]; i; i = nxt[i]) q.push(to[i]);
  while (!q.empty()) {
    int y = q.top();
    q.pop();
    dfs(y);
  }
}
void solve() {
  freopen("permutation.in", "r", stdin);
  freopen("permutation.out", "w", stdout);
  scanf("%d%d", &n, &m);
  int x(0);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &x);
    b[i] = x;
    t[x] = i;
  }
  for (int i = 1; i <= n; ++i) {
    int ps = qury(1, 1, n, t[i] + 1, t[i] + m - 1);
    upd(1, 1, n, t[i], i);
    add(t[ps], t[i]);
  }
  dfs();
  for (int i = 1; i <= n; ++i) b[s[i]] = i;
  for (int i = 1; i <= n; ++i) printf("%d\n", b[i]);
}
}  // namespace solver
int main() { solver ::solve(); }
