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
/*
 * Author       : YangDavid
 * Created Time : 2019年07月12日 星期五 20时51分56秒
 */

#include<bits/stdc++.h>
#define rep(i, n) for(int i = 1; i <= n; ++i)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;

const int maxn = 555555;
int mx[maxn << 1], n, k, p[maxn], q[maxn], ans[maxn];
#define lson (o << 1)
#define rson (o << 1 | 1)

void modify(int o, int l, int r, int d, int v) {
    if(l == r) { mx[o] = v; return; }
    int mid = (l + r) >> 1;
    if(d <= mid) modify(lson, l, mid, d, v);
    else modify(rson, mid + 1, r, d, v);
    mx[o] = max(mx[lson], mx[rson]);
}
int query(int o, int l, int r, int ql, int qr) {
    if(ql <= l && r <= qr) return mx[o];
    int mid = (l + r) >> 1, res = 0;
    if(ql <= mid) res = max(res, query(lson, l, mid, ql, qr));
    if(qr > mid) res = max(res, query(rson, mid + 1, r, ql, qr));
    return res;
}
vector<int> G[maxn];
int indeg[maxn];
void add(int from, int to) { 
    indeg[to]++;
    G[from].push_back(to); 
}

void toposort() {
    int cnt = 0;
    priority_queue<int, vector<int>, greater<int> > pq;
    for(int i = 1; i <= n; ++i) if(indeg[i] == 0)
        pq.push(i);
    while(!pq.empty()) {
        int f = pq.top(); pq.pop();
        ans[f] = ++cnt;
        for(auto g : G[f]) if(--indeg[g] == 0)
            pq.push(g);
    }
}
int main() {
    scanf("%d%d", &n, &k);
    rep(i, n) scanf("%d", &p[i]), q[p[i]] = i;
    for(int i = 1; i <= n; ++i) {
        int small = query(1, 1, n, max(1, q[i]-k+1), q[i]);
        if(small) add(q[small], q[i]);
        int big = query(1, 1, n, q[i], min(n, q[i] + k - 1));
        if(big) add(q[big], q[i]);
        modify(1, 1, n, q[i], i);
    }
    toposort();
    rep(i, n) printf("%d\n", ans[i]);

    return 0;
}
