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<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<set>
#include<queue>
using namespace std;
const int N=500005;
int n,K,i,j,k,l,a[N],mn[N*5],head[N],adj[N*2],nxt[N*2],d[N],ans[N];
priority_queue<int,vector<int>,greater<int> > q;
void addedge(int u,int v)
{
	adj[++l]=v;
	nxt[l]=head[u];
	head[u]=l;
	++d[v];
}
void built(int o,int l,int r)
{
	mn[o]=1<<30;
	if(l==r)
		return;
	int mid=l+r>>1;
	built(o<<1,l,mid);
	built(o<<1|1,mid+1,r);
}
void update(int o,int l,int r,int x,int y)
{
	if(l==r)
	{
		mn[o]=min(mn[o],y);
		return;
	}
	int mid=l+r>>1;
	if(x<=mid)
		update(o<<1,l,mid,x,y);
	else
		update(o<<1|1,mid+1,r,x,y);
	mn[o]=min(mn[o<<1],mn[o<<1|1]);
}
int query(int o,int l,int r,int x,int y)
{
	if(l>=x&&r<=y)
		return mn[o];
	int mid=l+r>>1,rtn=1<<30;
	if(x<=mid)
		rtn=query(o<<1,l,mid,x,y);
	if(y>mid)
		rtn=min(rtn,query(o<<1|1,mid+1,r,x,y));
	return rtn;
}
int main()
{
	scanf("%d%d",&n,&K);
	for(i=1;i<=n;++i)
	{
		scanf("%d",&j);
		a[j]=i;
	}
	built(1,1,n);
	for(i=n;i>=1;--i)
	{
		j=query(1,1,n,a[i],min(n,a[i]+K-1));
		if(j<(1<<30))
			addedge(a[i],a[j]);
		j=query(1,1,n,max(1,a[i]-K+1),a[i]);
		if(j<(1<<30))
			addedge(a[i],a[j]);
		update(1,1,n,a[i],i);
	}
	for(i=1;i<=n;++i)
		if(!d[i])
			q.push(i);
	k=0;
	while(!q.empty())
	{
		i=q.top();
		q.pop();
		ans[i]=++k;
		for(j=head[i];j;j=nxt[j])
		{
			--d[adj[j]];
			if(!d[adj[j]])
				q.push(adj[j]);
		}
	}
	for(i=1;i<=n;++i)
		printf("%d\n",ans[i]);
	return 0;
}
