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;
template <class V, int NV>
class SegTree_Pair {
 public:
  vector<pair<V, int> > val;
  static V const def = 1 << 20;
  pair<V, int> comp(pair<V, int> l, pair<V, int> r) { return max(l, r); }
  SegTree_Pair() {
    val.resize(NV * 2);
    int i;
    for (i = 0; i < (NV); i++) val[i + NV] = make_pair(def, i);
    for (i = NV - 1; i >= 1; i--) val[i] = comp(val[2 * i], val[2 * i + 1]);
  };
  pair<V, int> getval(int x, int y, int l = 0, int r = NV, int k = 1) {
    if (r <= x || y <= l) return make_pair(def, NV);
    if (x <= l && r <= y) return val[k];
    return comp(getval(x, y, l, (l + r) / 2, k * 2),
                getval(x, y, (l + r) / 2, r, k * 2 + 1));
  }
  void update(int entry, V v) {
    entry += NV;
    val[entry] = make_pair(v, entry - NV);
    while (entry > 1)
      entry >>= 1, val[entry] = comp(val[entry * 2], val[entry * 2 + 1]);
  }
};
SegTree_Pair<int, 1 << 20> seg;
int N, K;
int P[501010];
int Q[501010];
int vis[505050];
void solve() {
  int i, j, k, l, r, x, y;
  string s;
  cin >> N >> K;
  for (i = 0; i < (N); i++) {
    cin >> P[i];
    P[i]--;
    Q[P[i]] = i;
  }
  assert(N < 1000);
  for (j = 0; j < (N); j++) {
    for (i = 0; i < (N); i++) {
      x = P[i];
      while (x) {
        if (Q[x - 1] > Q[x] && Q[x - 1] - Q[x] >= K) {
          swap(P[Q[x]], P[Q[x - 1]]);
          swap(Q[x], Q[x - 1]);
          x--;
        } else
          break;
      }
    }
  }
  for (i = 0; i < (N); i++) (void)printf("%d\n", P[i] + 1);
}
int main(int argc, char** argv) {
  string s;
  int i;
  if (argc == 1) ios::sync_with_stdio(false), cin.tie(0);
  for (i = 0; i < (argc - 1); i++) s += argv[i + 1], s += '\n';
  for (i = 0; i < (s.size()); i++) ungetc(s[s.size() - 1 - i], stdin);
  solve();
  return 0;
}
