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 MOD = 1000000007;
const int INF = 2e9;
const long long INFLL = 1e18;
const int MAX_N = 500000;
int N, K;
int arr[MAX_N + 1];
int idx[MAX_N + 1];
struct SEG {
  struct NODE {
    int l, r;
    int data;
  };
  vector<NODE> seg;
  int SZ;
  void add() { seg.push_back({-1, -1, 0}); }
  void Init(int x) {
    SZ = x;
    add();
    init(0, 1, SZ);
  }
  void init(int idx, int s, int e) {
    if (s == e) return;
    seg[idx].l = seg.size();
    add();
    seg[idx].r = seg.size();
    add();
    init(seg[idx].l, s, (s + e) / 2);
    init(seg[idx].r, (s + e) / 2 + 1, e);
  }
  void Update(int x, int y) { update(0, 1, SZ, x, y); }
  void update(int idx, int s, int e, int x, int y) {
    seg[idx].data += y;
    if (s == e) return;
    if (x <= (s + e) / 2)
      update(seg[idx].l, s, (s + e) / 2, x, y);
    else
      update(seg[idx].r, (s + e) / 2 + 1, e, x, y);
  }
  int Sum(int x, int y) { return sum(0, 1, SZ, x, y); }
  int sum(int idx, int s, int e, int x, int y) {
    if (x <= s && e <= y)
      return seg[idx].data;
    else if (x > e || y < s)
      return 0;
    return sum(seg[idx].l, s, (s + e) / 2, x, y) +
           sum(seg[idx].r, (s + e) / 2 + 1, e, x, y);
  }
};
SEG Seg1, Seg2;
int ans[MAX_N + 1], ans2[MAX_N + 1];
int main() {
  scanf("%d%d", &N, &K);
  Seg1.Init(N);
  Seg2.Init(N);
  for (int i = 1; i <= N; i++) {
    Seg2.Update(i, 1);
    int x;
    scanf("%d", &x);
    arr[i] = x;
    idx[x] = i;
  }
  for (int i = 2; i <= K; i++) {
    Seg1.Update(idx[i], 1);
  }
  for (int i = 1; i <= N; i++) {
    int k = Seg1.Sum(1, idx[i]);
    int s = 1, e = N, m;
    while (s < e) {
      m = (s + e) / 2;
      if (Seg2.Sum(1, m) >= k + 1) {
        e = m;
      } else {
        s = m + 1;
      }
    }
    ans[s] = i;
    Seg2.Update(s, -1);
    if (i != N) {
      Seg1.Update(idx[i + 1], -1);
    }
    if (i + K <= N) {
      Seg1.Update(idx[i + K], 1);
    }
  }
  for (int i = 1; i <= N; i++) {
    ans[ans2[i]] = i;
  }
  for (int i = 1; i <= N; i++) {
    printf("%d\n", ans[i]);
  }
  return 0;
}
