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 <queue>
#include <cstdio>
#include <cstring>

struct IO{
    IO(){}
#define gc getchar
    inline IO&operator>>(int&_){
        _=0; bool f=0; char c=gc();
        while(c>'9' || c<'0') f|=(c=='-'), c=gc();
        while(c>='0' && c<='9') _*=10, _+=c&15, c=gc();
        _=f?-_:_; return*this;
    }
    inline IO&operator<<(int x){
        if(!x){putchar(48);goto f;}
        if(x<0) putchar('-'),x=~x+1;
        static short wt[20],len;len=0;
        for(;x;x/=10) wt[++len] = x%10;
        while(len)putchar(wt[len--]+48);
        f: putchar('\n'); return *this;
    }
    inline int operator()(){
        int _=0; short f=1; char c=gc();
        while(c>'9' || c<'0') f=(c=='-')?-1:1, c=gc();
        while(c>='0' && c<='9')_*=10, _+=c&15, c=gc(); return _*f;
    }
#undef gc
}io;

#define N 500005

inline int min(int a,int b){ return a<b?a:b; }
inline int max(int a,int b){ return a>b?a:b; }

int n,k,P[N],Ans[N];

struct Segement_Tree{
#define mid (l+r>>1)
#define lson ll,rr,ls
#define rson ll,rr,rs
#define inf 0x7f7f7f7f
#define ls id<<1,l,mid
#define rs id<<1|1,mid+1,r
	int tag[N<<2];
	
	inline void init(){ memset(tag,inf,sizeof tag); }
	
	inline void mdy(int p,int v,int id=1,int l=1,int r=n){
		if(l==r){ tag[id]=v; return; }
		p<=mid?mdy(p,v,ls):mdy(p,v,rs);
		tag[id]=min(tag[id<<1],tag[id<<1|1]);
	}
	
	inline int Query(int ll,int rr,int id=1,int l=1,int r=n){
		if(ll<=l && r<=rr || tag[id]==inf) return tag[id];
		if(rr<=mid) return Query(lson);
		if(ll> mid) return Query(rson);
		return min(Query(lson),Query(rson));
	}
}sg;

int head[N],tot,In[N];
struct edge{ int to,nxt; }e[N<<1];
inline void addedge(int u,int v){ e[++tot].nxt=head[u]; head[u]=tot; e[tot].to=v; ++In[v]; }

std::priority_queue<int,std::vector<int>,std::greater<int> >q;

int main(){
	io>>n>>k; sg.init(); --k;
	for(int i=1;i<=n;++i) P[io()]=i;
	for(int i=n,ps;i;--i){
		ps=sg.Query(P[i],min(P[i]+k,n));
		(ps^inf)?addedge(P[i],P[ps]):void();
		ps=sg.Query(max(P[i]-k,1),P[i]);
		(ps^inf)?addedge(P[i],P[ps]):void(); sg.mdy(P[i],i);
	}
	for(int i=1;i<=n;++i) (!In[i])?q.push(i):void();
	for(int rk=0;!q.empty();){
		//得到最小的字典序 
		Ans[++rk]=q.top(); q.pop();
		for(int i=head[Ans[rk]];i;i=e[i].nxt)
			(!--In[e[i].to])?q.push(e[i].to):void();
	}
	for(int i=1;i<=n;++i) io<<Ans[i];
	return 0;
}