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 INF 0x3f3f3f3f
#define re register
#define LL long long
#define MOD 1000000007
#define MAXN 500005
#define lson (now<<1)
#define rson ((now<<1)|1)
using namespace std;
struct Edge{
	int to,nex;Edge(int _=0,int __=0){to=_,nex=__;}
}e[MAXN<<1];
int n,k,cnt,tot,hd[MAXN],du[MAXN],p[MAXN],ans[MAXN],t[MAXN<<2];
priority_queue<int,vector<int>,greater<int> >q;
int rd(){
	int x=0,tp=1;char c;c=getchar();
	while(c<'0' || c>'9'){if(c=='-')tp=-1;c=getchar();}
	while(c>='0' && c<='9'){x=(x*10+c-'0');c=getchar();}
	return x*tp;
}
void adde(int x,int y){
	e[++cnt]=Edge(y,hd[x]);
	hd[x]=cnt,du[y]++;
}
void update(int now,int l,int r,int pos,int V){
	if(l==r){t[now]=V;return;}
	int mid=(l+r)>>1;
	if(pos<=mid)update(lson,l,mid,pos,V);
	else update(rson,mid+1,r,pos,V);
	t[now]=min(t[lson],t[rson]);
}
int query(int now,int l,int r,int L,int R){
	if(L<=l && r<=R)return t[now];
	int mid=(l+r)>>1,res=INF;
	if(L<=mid)res=query(lson,l,mid,L,R);
	if(mid<R)res=min(res,query(rson,mid+1,r,L,R));
	return res;
}
void topo(){
	for(int i=1;i<=n;i++)if(!du[i])q.push(i);
	while(!q.empty()){
		int now=q.top();q.pop();
		ans[now]=++tot;
		for(int i=hd[now];i;i=e[i].nex){
			du[e[i].to]--;
			if(!du[e[i].to])q.push(e[i].to);
		}
	}
}
int main(){
	// freopen("testdata.in","r",stdin);
	// freopen("shit.out","w",stdout);
	int tmp;
	memset(t,INF,sizeof(t));
	n=rd(),k=rd();
	for(int i=1;i<=n;i++)p[rd()]=i;
	for(int i=n;i>=1;i--){
		tmp=query(1,1,n,p[i],min(n,p[i]+k-1));
		if(tmp<INF)adde(p[i],p[tmp]);
		tmp=query(1,1,n,max(1,p[i]-k+1),p[i]);
		if(tmp<INF)adde(p[i],p[tmp]);
		update(1,1,n,p[i],i);
	}
	topo();
	for(int i=1;i<=n;i++)printf("%d\n",ans[i]);
	// printf("%.2lf\n",(double)clock()/CLOCKS_PER_SEC);
	return 0;
}