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
//2018.9.21 by ljz
#include<bits/stdc++.h>
using namespace std;
#define res register int
#define LL long long
#define inf 0x3f3f3f3f
#define eps 1e-15
inline int read(){
    res s=0;
    bool w=0;
    char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')w=1;ch=getchar();}
    while(ch>='0'&&ch<='9')s=s*10+ch-'0',ch=getchar();
    return w?-s:s;
}
inline void _swap(res &x,res &y){
    x^=y^=x^=y;
}
inline int _abs(const res &x){
    return x>0?x:-x;
}
inline int _max(const res &x,const res &y){
    return x>y?x:y;
}
inline int _min(const res &x,const res &y){
    return x<y?x:y;
}
const int N=1e6+10;
namespace MAIN{
    int a[N],n,k;
    namespace Segtree{
        int mn[N<<2];
        inline void pushup(const res &rt){
            mn[rt]=_min(mn[rt<<1],mn[rt<<1|1]);
        }
        void build(const res &rt,const res &l,const res &r){
            mn[rt]=inf;
            if(l==r)return;
            res mid=(l+r)>>1;
            build(rt<<1,l,mid),build(rt<<1|1,mid+1,r);
        }
        void update(const res &rt,const res &l,const res &r,const res &p,const res &va){
            if(l==r){mn[rt]=va;return;}
            res mid=(l+r)>>1;
            if(p<=mid)update(rt<<1,l,mid,p,va);
            else update(rt<<1|1,mid+1,r,p,va);
            pushup(rt);
        }
        int query(const res &rt,const res &l,const res &r,const res &L,const res &R){
            if(L>R)return 0;
            if(L<=l&&r<=R)return mn[rt];
            res mid=(l+r)>>1,ans=inf;
            if(L<=mid)ans=_min(ans,query(rt<<1,l,mid,L,R));
            if(R>mid)ans=_min(ans,query(rt<<1|1,mid+1,r,L,R));
            return ans;
        }
    }
    struct E{
        int next,to;
        E() {}
        E(res next,res to):next(next),to(to) {}
    }edge[N];
    int head[N],cnt,du[N];
    inline void addedge(const res &u,const res &v){
        edge[++cnt]=E(head[u],v),head[u]=cnt,du[v]++;
    }
    int x;
    priority_queue<int,vector<int>,greater<int> >Q;
    int id[N],idx;
    inline void topsort(){
        for(res i=1;i<=n;i++)if(!du[i])Q.push(i);
        while(!Q.empty()){
            res u=Q.top();
            Q.pop();
            id[u]=++idx;
            for(res i=head[u];~i;i=edge[i].next){
                res tox=edge[i].to;
                if(--du[tox]==0)Q.push(tox);
            }
        }
    }
    inline void MAIN(){
        memset(head,-1,sizeof(head));
        n=read(),k=read();
        for(res i=1;i<=n;i++)a[read()]=i;
        Segtree::build(1,1,n);
        for(res i=n;i;i--){
            x=Segtree::query(1,1,n,a[i]+1,_min(a[i]+k-1,n));
            if(x!=inf)addedge(a[i],a[x]);
            x=Segtree::query(1,1,n,_max(1,a[i]-k+1),a[i]-1);
            if(x!=inf)addedge(a[i],a[x]);
            Segtree::update(1,1,n,a[i],i);
        }
        topsort();
        for(res i=1;i<=n;i++)printf("%d\n",id[i]);
    }
}
int main(){
    MAIN::MAIN();
    return 0;
}