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 rep(i, x, y) for (int i = x; i <= y; i++)
using namespace std;

const int N = 5e5 + 10, inf = 0x3f3f3f3f;
int n, K, a[N], x, ans[N];
int mn[N << 2], deg[N];
priority_queue<int, vector<int>, greater<int> >q;  // 用 pq 来求最小拓扑序
vector<int> e[N];

void upd(int x) { mn[x] = min(mn[x << 1], mn[x << 1 | 1]); }

void modify(int x, int l, int r, int pos, int v) {
    if (l == r) { mn[x] = v; return; }
    int mid = (l + r) >> 1;
    if (pos <= mid) modify(x << 1, l, mid, pos, v);
    else modify(x << 1 | 1, mid + 1, r, pos, v);
    upd(x);
}

int query(int x, int l, int r, int lx, int rx) {
    if (rx < l || lx > r) return inf;
    if (lx <= l && r <= rx) return mn[x];
    int mid = (l + r) >> 1;
    return min(query(x << 1, l, mid, lx, rx), query(x << 1 | 1, mid + 1, r, lx, rx));
}

int main() {
    cin >> n >> K;
    rep(i, 1, n) scanf("%d", &x), a[x] = i;
    memset(mn, 0x3f, sizeof(mn));
    for (int i = n, j; i >= 1; i--) {
        if ((j = query(1, 1, n, a[i] + 1, a[i] + K - 1)) != inf)
            ++deg[a[j]], e[a[i]].push_back(a[j]);
        if ((j = query(1, 1, n, a[i] - K + 1, a[i] - 1)) != inf)
            ++deg[a[j]], e[a[i]].push_back(a[j]);
        modify(1, 1, n, a[i], i);
    }
    rep(i, 1, n) if (!deg[i]) q.push(i);
    int tot = 0;
    while (q.size()) {
        int x = q.top(); q.pop();
        a[++tot] = x;
        for (int i = 0; i < e[x].size(); i++) {
            int y = e[x][i];
            if (!(--deg[y])) q.push(y);
        }
    }
    rep(i, 1, n) ans[a[i]] = i;
    rep(i, 1, n) printf("%d\n", ans[i]);
    return 0;
}
