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>
#define int long long
#define rep(i, n) for (int i = 1; i <= (n); i ++)
#define travel(i, u) for (int i = head[u]; i; i = e[i].nxt)
#define rint register int
using namespace std;

typedef long long LL;

template<typename tp> inline void read(tp &x) {
  x = 0; char c = getchar(); int f = 0;
  for (; c < '0' || c > '9'; f |= c == '-', c = getchar());
  for (; c >= '0' && c <= '9'; x = (x << 3) + (x << 1) + c - '0', c = getchar());
  if (f) x = -x;
}
const int N = 3e5 + 233;

int n, K;
int a[N], b[N], du[N];
vector <int> G[N];
namespace bit {
  const int xb = N << 2;
  int tr[N << 4], tp;
  inline void init(int f) {
    tp = f;
    if (tp == 0) memset(tr, 38, sizeof tr);
    else memset(tr, 168, sizeof tr);
  }
  inline void U(int &x, int v) {
    if (tp == 0) x = min(x, v);
    if (tp == 1) x = max(x, v);
  }
  inline void add(int x, int v) {
    for (x += xb; x; x >>= 1) U(tr[x], v);
  }
  inline int query(int s, int t) {
    s = max(s, 1LL); t = min(t, n);
    int ans = tp == 0 ? 1e18 : -1e18;
    for (s += xb - 1, t += xb + 1; s ^ t ^ 1; s >>= 1, t >>= 1) {
      if (~s & 1) U(ans, tr[s ^ 1]);
      if ( t & 1) U(ans, tr[t ^ 1]);
    }
    return ans;
  }
}

inline void link(int x, int y) {
  if (!(1 <= x && x <= n && 1 <= y && y <= n))
    return ;
  x = b[x]; y = b[y];
  // cout << x << " " << y << "\n";
  ++ du[y]; G[x].push_back(y);
}

main(void) {
  read(n); read(K);
  rep (i, n) read(a[i]), b[a[i]] = i;
  // rep (i, n) cout << b[i] << " "; cout << "\n";
  bit::init(1);
  for (int i = 1; i <= n; i ++) {
    link(bit::query(b[i] - K + 1, b[i] + K - 1), i);
    bit::add(b[i], i);
  }
  bit::init(0);
  for (int i = n; i >= 1; i --) {
    link(i, bit::query(b[i] - K + 1, b[i] + K - 1));
    bit::add(b[i], i);
  }
  priority_queue < int, vector <int>, greater <int> > pq;
  rep (i, n) if (!du[i]) pq.push(i);
  vector <int> ans;
  while (!pq.empty()) {
    int u = pq.top(); pq.pop();
    ans.push_back(u);
    for (auto v : G[u]) if (!-- du[v]) pq.push(v);
  }
  for (auto i : ans) cout << i << "\n";
}
