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>
int k, tot, n, m, p[100001], q[100001], l[400001], r[400001], f[400001],
    lz[400001], dbd, fir[100001], nex[100001], sto[100001], ru[100001];
void addbian(int aa, int bb) {
  tot++;
  nex[tot] = fir[aa];
  fir[aa] = tot;
  sto[tot] = bb;
}
int getmin(int aa, int bb) {
  if (aa < bb)
    return (aa);
  else
    return (bb);
}
void update(int num, int hh) {
  lz[num] = hh;
  f[num] = hh;
}
void built(int num, int x, int y) {
  l[num] = x;
  r[num] = y;
  f[num] = dbd;
  lz[num] = 0;
  if (x == y) return;
  int mid = (x + y) / 2;
  built(num * 2, x, mid);
  built(num * 2 + 1, mid + 1, y);
}
int ask(int num, int x) {
  if (l[num] == r[num]) return (f[num]);
  int mid = (l[num] + r[num]) / 2;
  if (lz[num] > 0) {
    update(num * 2, lz[num]);
    update(num * 2 + 1, lz[num]);
    lz[num] = 0;
  }
  if (x <= mid)
    return (ask(num * 2, x));
  else
    return (ask(num * 2 + 1, x));
  f[num] = getmin(f[num * 2], f[num * 2 + 1]);
}
void gai(int num, int x, int y) {
  if ((x == l[num]) && (y == r[num])) {
    update(num, dbd);
    return;
  }
  int mid = (l[num] + r[num]) / 2;
  if (lz[num] > 0) {
    update(num * 2, lz[num]);
    update(num * 2 + 1, lz[num]);
    lz[num] = 0;
  }
  if (y <= mid)
    gai(num * 2, x, y);
  else {
    if (x > mid)
      gai(num * 2 + 1, x, y);
    else {
      gai(num * 2, x, mid);
      gai(num * 2 + 1, mid + 1, y);
    }
  }
  f[num] = getmin(f[num * 2], f[num * 2 + 1]);
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &p[i]);
    q[p[i]] = i;
  }
  dbd = 0;
  built(1, 1, n);
  for (int i = 1; i <= n; i++) {
    int bb = ask(1, q[i]);
    if (bb != 0) {
      addbian(bb, q[i]);
      ru[q[i]]++;
    }
    int li = 1, ri = q[i];
    if (q[i] - k + 1 > 1) li = q[i] - k + 1;
    dbd = q[i];
    gai(1, li, ri);
  }
  dbd = n + 1;
  built(1, 1, n);
  for (int i = 1; i <= n; i++)
    if (ru[i] == 0) {
      dbd = i;
      gai(1, i, i);
    }
  for (int i = 1; i <= n; i++) {
    int bb = fir[f[1]], cc = f[1];
    while (bb != 0) {
      ru[sto[bb]]--;
      if (ru[sto[bb]] == 0) {
        dbd = sto[bb];
        gai(1, dbd, dbd);
      }
      bb = nex[bb];
    }
    p[cc] = i;
    dbd = n + 1;
    gai(1, cc, cc);
  }
  for (int i = 1; i <= n; i++) printf("%d\n", p[i]);
}
