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 FO(i,a,b) for (int i = (a); i < (b); i++)
#define sz(v) int(v.size())

using namespace std;

int n, k;
int o[500005], a[500005];

int rt[1000005], rtt[1000005], T;
bool rpv[500005];

bool qs(int l, int r) {
    l = max(l,0);
    r = min(r,n);
    for (l += n, r += n; l < r; l /= 2, r /= 2) {
        if (l&1) if (rtt[l++] == T) return true;
        if (r&1) if (rtt[--r] == T) return true;
    }
    return false;
}

void up(int i) {
    for (i += n; i; i /= 2) rtt[i] = T;
}

void go(int i, int j) {
    if (i == j) return;
    else {
        int pv = i + rand() % (j-i);
        T++; up(a[pv]);
        for (int t = pv-1; t >= i; t--) {
            rpv[t] = qs(a[t]-k+1, a[t]+k);
            if (rpv[t]) up(a[t]);
        }
        T++; up(a[pv]);
        for (int t = pv+1; t < j; t++) {
            rpv[t] = qs(a[t]-k+1, a[t]+k);
            if (rpv[t]) up(a[t]);
        }

        vector<int> l, r;
        FO(t,i,pv) {
            if (rpv[t] || a[t] < a[pv]) l.push_back(a[t]);
            else r.push_back(a[t]);
        }
        FO(t,pv+1,j) {
            if (rpv[t] || a[t] > a[pv]) r.push_back(a[t]);
            else l.push_back(a[t]);
        }
        int apv = a[pv];
        int t = i;
        for (int x : l) a[t++] = x;
        int md = t;
        a[t++] = apv;
        for (int x : r) a[t++] = x;
        assert(t == j);
        go(i,md);
        go(md+1,j);
    }
}

int main() {
    scanf("%d %d", &n, &k);
    FO(i,0,n) {
        scanf("%d", o+i); o[i]--;
        a[o[i]] = i;
    }
    go(0,n);
    FO(i,0,n) o[a[i]] = i+1;
    FO(i,0,n) printf("%d\n", o[i]);
}