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 long long MAXN = (1 << 19);
long long mi[2 * MAXN];
long long add[2 * MAXN];
long long sum[2 * MAXN];
long long n, k;
long long p[MAXN];
long long a[MAXN];
long long inf = 1e9;
void update(long long i, long long l, long long r, long long left,
            long long right, long long x) {
  if (l == left && r == right) {
    add[i] += x;
    mi[i] += x;
    return;
  }
  long long m = (l + r) / 2;
  if (right <= m)
    update(i * 2, l, m, left, right, x);
  else if (left >= m)
    update(i * 2 + 1, m, r, left, right, x);
  else {
    update(i * 2, l, m, left, m, x);
    update(i * 2 + 1, m, r, m, right, x);
  }
  mi[i] = min(mi[i * 2], mi[i * 2 + 1]) + add[i];
}
long long find_first(long long i, long long l, long long r, long long carry) {
  if (r == l + 1) return l;
  carry += add[i];
  if (mi[i * 2] <= mi[i * 2 + 1])
    return find_first(i * 2, l, (l + r) / 2, carry);
  return find_first(i * 2 + 1, (l + r) / 2, r, carry);
}
long long find_sum(long long i, long long l, long long r, long long left,
                   long long right) {
  if (l == left && r == right) return sum[i];
  long long m = (l + r) / 2;
  if (right <= m) return find_sum(i * 2, l, m, left, right);
  if (left >= m) return find_sum(i * 2 + 1, m, r, left, right);
  return find_sum(i * 2, l, m, left, m) + find_sum(i * 2 + 1, m, r, m, right);
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  for (long long i = 0; i < n; i++) {
    cin >> p[i];
    p[i]--;
    a[p[i]] = i;
  }
  for (long long i = MAXN + n; i < 2 * MAXN; i++) mi[i] = inf;
  for (long long i = MAXN - 1; i >= 1; i--)
    mi[i] = min(mi[i * 2], mi[i * 2 + 1]);
  for (long long i = 0; i < n; i++) {
    long long e = MAXN + a[i];
    mi[e] = find_sum(1, 0, MAXN, max(0ll, a[i] - k + 1), min(n, a[i] + k));
    e /= 2;
    while (e != 0) {
      mi[e] = min(mi[e * 2], mi[e * 2 + 1]);
      e /= 2;
    }
    e = MAXN + a[i];
    sum[e] = 1;
    e /= 2;
    while (e > 0) {
      sum[e] = sum[e * 2] + sum[e * 2 + 1];
      e /= 2;
    }
  }
  for (long long i = 0; i < n; i++) {
    long long j = find_first(1, 0, MAXN, 0);
    cout << j + 1 << "\n";
    update(1, 0, MAXN, max(0ll, j - k + 1), min(n, j + k), -1);
    update(1, 0, MAXN, j, j + 1, inf);
  }
}
