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 = 1 << 30;
const int maxn = 2e6 + 5;
struct edges {
  int to, nxt;
} ed[maxn << 1];
int head[maxn], ecnt = 0;
int n, k, a[maxn], de[maxn];
vector<int> ans;
void add(int x, int y) {
  ed[++ecnt].to = y;
  ed[ecnt].nxt = head[x];
  head[x] = ecnt;
}
struct segm {
  int mn;
} se[maxn << 2];
void build(int x, int y, int num) {
  if (x == y) {
    se[num].mn = inf;
    return;
  }
  int mid = x + y >> 1;
  build(x, mid, num << 1);
  build(mid + 1, y, num << 1 | 1);
  se[num].mn = min(se[num << 1].mn, se[num << 1 | 1].mn);
}
void update(int l, int to, int x, int y, int num) {
  if (x == y) {
    se[num].mn = to;
    return;
  }
  int mid = x + y >> 1;
  if (l <= mid)
    update(l, to, x, mid, num << 1);
  else
    update(l, to, mid + 1, y, num << 1 | 1);
  se[num].mn = min(se[num << 1].mn, se[num << 1 | 1].mn);
}
int query(int l, int r, int x, int y, int num) {
  if (l > r) return 0;
  if (l <= x && y <= r) return se[num].mn;
  int mid = x + y >> 1;
  if (r <= mid)
    return query(l, r, x, mid, num << 1);
  else if (l > mid)
    return query(l, r, mid + 1, y, num << 1 | 1);
  else
    return min(query(l, mid, x, mid, num << 1),
               query(mid + 1, r, mid + 1, y, num << 1 | 1));
}
void topo() {
  priority_queue<int, vector<int>, greater<int> > Q;
  for (int i = 1; i <= n; i++) {
    if (de[i] == 0) Q.push(i);
  }
  while (!Q.empty()) {
    int tp = Q.top();
    Q.pop();
    ans.push_back(tp);
    for (int i = head[tp]; i != -1; i = ed[i].nxt) {
      int u = ed[i].to;
      --de[u];
      if (!de[u]) Q.push(u);
    }
  }
}
int main() {
  memset(head, -1, sizeof head);
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    a[x] = i;
  }
  build(1, n, 1);
  for (int i = n; i >= 1; i--) {
    int u = query(a[i] + 1, min(a[i] + k, n), 1, n, 1);
    int v = query(max(1, a[i] - k + 1), a[i] - 1, 1, n, 1);
    if (u >= 1 && u <= n) add(a[i], a[u]), ++de[a[u]];
    if (v >= 1 && v <= n) add(a[i], a[v]), ++de[a[v]];
    update(a[i], i, 1, n, 1);
  }
  topo();
  for (int i = 0; i < ans.size(); i++) printf("%d\n", ans[i]);
  return 0;
}
