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 int qr() {
  int ret = 0, f = 0, c = getchar();
  while (!isdigit(c)) f |= c == 45, c = getchar();
  while (isdigit(c)) ret = ret * 10 + c - 48, c = getchar();
  return f ? -ret : ret;
}
const int maxn = 5e5 + 5;
const int inf = 0x3f3f3f3f;
vector<int> e[maxn];
int data[maxn], arc[maxn], dr[maxn], n, k;
int seg[maxn << 2];
void pp(int pos) { seg[pos] = min(seg[pos << 1], seg[pos << 1 | 1]); }
void add(int fr, int to) {
  e[to].push_back(fr);
  ++dr[fr];
}
int que(int L, int R, int l, int r, int pos) {
  if (L > r || R < l) return inf;
  if (L <= l && r <= R) return seg[pos];
  return min(que(L, R, l, ((l + r) >> 1), pos << 1),
             que(L, R, ((l + r) >> 1) + 1, r, pos << 1 | 1));
}
void upd(int p, int v, int l, int r, int pos) {
  if (p < l || p > r) return;
  if (l == r) return seg[pos] = v, void();
  upd(p, v, l, ((l + r) >> 1), pos << 1);
  upd(p, v, ((l + r) >> 1) + 1, r, pos << 1 | 1);
  pp(pos);
}
int main() {
  n = qr();
  k = qr();
  for (int t = 1; t <= n; ++t) data[t] = qr(), arc[data[t]] = t;
  memset(seg, 0x3f, sizeof seg);
  for (int t = n; t; --t) {
    int t1 = que(arc[t] - k + 1, arc[t] - 1, 1, n, 1);
    int t2 = que(arc[t] + 1, arc[t] + k - 1, 1, n, 1);
    if (t1 <= n) add(arc[t], arc[t1]);
    if (t2 <= n) add(arc[t], arc[t2]);
    upd(arc[t], t, 1, n, 1);
  }
  static priority_queue<int> q;
  static vector<int> ans;
  for (int t = 1; t <= n; ++t)
    if (!dr[t]) q.push(t);
  while (q.size()) {
    int now = q.top();
    ans.push_back(now);
    q.pop();
    for (auto t : e[now])
      if (--dr[t] == 0) q.push(t);
  }
  reverse(ans.begin(), ans.end());
  for (auto t : ans) printf("%d\n", t);
  return 0;
}
