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;
inline void read(int &x) {
  x = 0;
  bool flag = 0;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') {
      flag = 1;
    }
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - 48;
    ch = getchar();
  }
  if (flag) {
    x = -x;
  }
}
const int N = 500005;
int n, k, p[N], ans[N];
int pos[N << 2];
bool inq[N];
inline int merge(int x, int y) { return p[x] > p[y] ? x : y; }
inline void pushup(int p) { pos[p] = merge(pos[p << 1], pos[p << 1 | 1]); }
void build(int p, int l, int r) {
  if (l == r) {
    pos[p] = l;
    return;
  }
  int mid = l + r >> 1;
  build(p << 1, l, mid);
  build(p << 1 | 1, mid + 1, r);
  pushup(p);
}
int query(int p, int l, int r, int L, int R) {
  if (l > R || r < L) {
    return 0;
  }
  if (l >= L && r <= R) {
    return pos[p];
  }
  int mid = l + r >> 1;
  return merge(query(p << 1, l, mid, L, R),
               query(p << 1 | 1, mid + 1, r, L, R));
}
void modify(int p, int l, int r, int x) {
  if (l == r) {
    pos[p] = 0;
    return;
  }
  int mid = l + r >> 1;
  if (mid >= x) {
    modify(p << 1, l, mid, x);
  } else {
    modify(p << 1 | 1, mid + 1, r, x);
  }
  pushup(p);
}
int main() {
  read(n), read(k);
  for (int i = 1; i <= n; ++i) {
    read(p[i]);
  }
  build(1, 1, n);
  priority_queue<int> q;
  auto check = [&](int pos) {
    if (pos && !inq[pos]) {
      if (pos == query(1, 1, n, pos - k + 1, pos + k - 1)) {
        q.push(pos);
        inq[pos] = 1;
      }
    }
  };
  for (int i = 1; i <= n; ++i) {
    check(i);
  }
  for (int i = n; i; --i) {
    int pos = q.top();
    q.pop();
    ans[i] = pos;
    modify(1, 1, n, pos);
    check(query(1, 1, n, pos - k + 1, pos - 1));
    check(query(1, 1, n, pos + 1, pos + k - 1));
  }
  for (int i = 1; i <= n; ++i) {
    printf("%d\n", ans[i]);
  }
  return 0;
}
