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;

const int N = 5e5+7;
int tr[4*N];

void update(int u, int st, int en, int idx, int x) {
    if (st == en)   tr[u] = x;
    else {
        int mid = (st+en)/2;
        if (idx <= mid) update(2*u, st, mid, idx, x);
        else             update(2*u+1, mid+1, en, idx, x);
        tr[u] = max(tr[2*u], tr[2*u+1]);
    }
}

int query(int u, int st, int en, int l, int r) {
    if (r<st || en<l)           return 0;
    else if (l<=st && en<=r)    return tr[u];
    else {
        int mid = (st+en)/2;
        return max(query(2*u, st, mid, l, r), query(2*u+1, mid+1, en, l, r));
    }
}

int a[N], b[N], out[N];
vector<int> in[N];
void add(int u, int v) {
    out[u]++;
    in[v].push_back(u);
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int n, k;
    cin>>n>>k;

    for (int i=1; i<=n; i++) {
        cin>>a[i];
        b[a[i]] = i;
    }

    for (int i=1; i<=n; i++) {
        int l1 = query(1,1,n,b[i]-k+1,b[i]);
        int l2 = query(1,1,n,b[i],b[i]+k-1);

        if (l1)        add(b[l1], b[i]);
        if (l2)        add(b[l2], b[i]);
        update(1,1,n,b[i],i);
    }

    vector<int> ans;
    priority_queue<int> pq;
    for (int i=1; i<=n; i++)
        if (out[i] == 0)
            pq.push(i);

    while (pq.size()) {
        int u = pq.top();
        pq.pop();
        ans.push_back(u);

        for (int v: in[u]) {
            out[v]--;
            if (out[v] == 0)    pq.push(v);
        }
    }

    reverse(ans.begin(), ans.end());
    for (int i=1; i<=n; i++)    a[ans[i-1]] = i;
    for (int i=1; i<=n; i++)    cout<<a[i]<<"\n";
}
