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>
typedef long long ll;
ll gi(){
	ll x=0,f=1;
	char ch=getchar();
	while(!isdigit(ch))f^=ch=='-',ch=getchar();
	while(isdigit(ch))x=x*10+ch-'0',ch=getchar();
	return f?x:-x;
}
int P[500010];
struct segtree{
	int A[2000010],tag[2000010];
#define mid ((l+r)>>1)
	void Upd(int x,int o){tag[x]=A[x]=o;}
	void down(int x){if(tag[x])Upd(x<<1,tag[x]),Upd(x<<1|1,tag[x]),tag[x]=0;}
	void update(int x,int l,int r,int L,int R,int d){
		if(L<=l&&r<=R)return Upd(x,d);
		down(x);
		if(L<=mid)update(x<<1,l,mid,L,R,d);
		if(mid<R)update(x<<1|1,mid+1,r,L,R,d);
	}
	int query(int x,int l,int r,int p){
		if(l==r)return A[x];
		down(x);
		if(p<=mid)return query(x<<1,l,mid,p);
		else return query(x<<1|1,mid+1,r,p);
	}
#undef mid
}A,B;
int fir[500010],dis[1000010],nxt[1000010],id,in[500010];
void link(int a,int b){++in[b];nxt[++id]=fir[a],fir[a]=id,dis[id]=b;}
int p[500010],tpn[500010];
struct cmp{bool operator()(int a,int b){return P[a]>P[b];}};
std::priority_queue<int,std::vector<int>,cmp>que;
int main(){
#ifdef XZZSB
	freopen("in.in","r",stdin);
	freopen("out.out","w",stdout);
#endif
	int n=gi(),K=gi()-1;
	for(int i=1;i<=n;++i)P[gi()]=i;
	for(int i=n,_;i;--i){
		if(_=A.query(1,1,n,P[i]))link(i,_);
		if(_=B.query(1,1,n,P[i]))link(i,_);
		A.update(1,1,n,P[i],std::min(n,P[i]+K),i);
		B.update(1,1,n,std::max(1,P[i]-K),P[i],i);
	}
	for(int i=1;i<=n;++i)if(!in[i])que.push(i);
	for(int _=1,x;_<=n;++_){
		tpn[_]=P[x=que.top()];que.pop();
		for(int i=fir[x];i;i=nxt[i])if(!--in[dis[i]])que.push(dis[i]);
	}
	for(int i=1;i<=n;++i)p[tpn[i]]=i;
	for(int i=1;i<=n;++i)printf("%d\n",p[i]);
	return 0;
}
