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 DIM = 5e5 + 5;
vector<int> edg[DIM];
priority_queue<int> prq;
int sgt[DIM << 2], pos[DIM], deg[DIM];
void update(int n, int l, int r, int p, int x) {
  if (l > r || l > p || p > r) return;
  if (l == p && p == r)
    sgt[n] = x;
  else {
    int m = (l + r) >> 1;
    update(n << 1, l, m, p, x);
    update(n << 1 | 1, m + 1, r, p, x);
    sgt[n] = max(sgt[n << 1], sgt[n << 1 | 1]);
  }
  return;
}
int query(int n, int l, int r, int st, int en) {
  if (l > r || l > en || st > r) return 0;
  int ans;
  if (st <= l && r <= en)
    ans = sgt[n];
  else {
    int m = (l + r) >> 1;
    ans = max(query(n << 1, l, m, st, en), query(n << 1 | 1, m + 1, r, st, en));
  }
  return ans;
}
int main(void) {
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    pos[x] = i;
  }
  for (int i = 1; i <= n; i++) {
    int qry1 = query(1, 1, n, max(1, pos[i] - k + 1), pos[i]);
    int qry2 = query(1, 1, n, pos[i], min(n, pos[i] + k - 1));
    if (qry1 != 0) {
      deg[pos[qry1]]++;
      edg[pos[i]].push_back(pos[qry1]);
    }
    if (qry2 != 0) {
      deg[pos[qry2]]++;
      edg[pos[i]].push_back(pos[qry2]);
    }
    update(1, 1, n, pos[i], i);
  }
  for (int i = 1; i <= n; i++) {
    if (deg[i] == 0) prq.push(i);
  }
  for (int i = n; i >= 1; i--) {
    pos[i] = prq.top();
    prq.pop();
    for (int x : edg[pos[i]]) {
      deg[x]--;
      if (deg[x] == 0) prq.push(x);
    }
  }
  for (int i = 1; i <= n; i++) cout << pos[i] << "\n";
  return 0;
}
