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;
constexpr int TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); }
struct Node {
  using NP = Node*;
  int ma = -1;
  int get(int a, int b) {
    if (b <= 0 or sz <= a) return -1;
    if (a <= 0 and sz <= b) return ma;
    return max(l->get(a, b), r->get(a - sz / 2, b - sz / 2));
  }
  void set(int k, int x) {
    if (sz == 1) {
      ma = x;
      return;
    }
    if (k < sz / 2)
      l->set(k, x);
    else
      r->set(k - sz / 2, x);
    ma = max(l->ma, r->ma);
  }
  NP l, r;
  int sz;
  Node(int sz) : sz(sz) {
    if (sz == 1) return;
    l = new Node(sz / 2);
    r = new Node(sz - sz / 2);
  }
};
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  int p[n], q[n];
  for (int i = 0; i < n; i++) {
    scanf("%d", p + i);
    p[i]--;
  }
  for (int i = 0; i < n; i++) q[p[i]] = i;
  Node* rmq = new Node(n);
  int mi[n];
  vector<vector<int>> g(n);
  for (int i = 0; i < n; i++) {
    {
      int v = rmq->get(max(0, q[i] - k + 1), q[i]);
      if (v != -1) {
        int qv = q[v];
        g[q[i]].push_back(qv);
      }
    }
    {
      int v = rmq->get(q[i], min(n, q[i] + k));
      if (v != -1) {
        int qv = q[v];
        g[q[i]].push_back(qv);
      }
      rmq->set(q[i], i);
    }
    rmq->set(q[i], i);
  }
  int deg[n];
  fill_n(deg, n, 0);
  for (int i = 0; i < n; i++)
    for (int j : g[i]) deg[j]++;
  priority_queue<int> que;
  for (int i = 0; i < n; i++)
    if (deg[i] == 0) que.push(i);
  vector<int> v;
  while (que.size()) {
    int p = que.top();
    que.pop();
    v.push_back(p);
    for (int d : g[p]) {
      deg[d]--;
      if (deg[d] == 0) que.push(d);
    }
  }
  reverse(v.begin(), v.end());
  int ans[n];
  for (int i = 0; i < n; i++) ans[v[i]] = i + 1;
  for (int i = 0; i < n; i++) printf("%d\n", ans[i]);
}
