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<iostream>
#include<cstdio>
#include<queue>
using namespace std;
const int N=3000005;
int n,k,a[N],p[N],h[N],cnt,d[N],tot;
struct xds
{
	int l,r,p;
}t[N];
struct qwe
{
	int ne,to;
}e[N];
int read()
{
	int r=0,f=1;
	char p=getchar();
	while(p>'9'||p<'0')
	{
		if(p=='-')
			f=-1;
		p=getchar();
	}
	while(p>='0'&&p<='9')
	{
		r=r*10+p-48;
		p=getchar();
	}
	return r*f;
}
void build(int ro,int l,int r)
{
	t[ro].l=l,t[ro].r=r,t[ro].p=n+1;
	if(l==r)
		return;
	int mid=(l+r)>>1;
	build(ro<<1,l,mid);
	build(ro<<1|1,mid+1,r);
}
void update(int ro,int p,int v)
{
	if(t[ro].l==t[ro].r)
	{
		t[ro].p=v;
		return;
	}
	int mid=(t[ro].l+t[ro].r)>>1;
	if(p<=mid)
		update(ro<<1,p,v);
	else
		update(ro<<1|1,p,v);
	t[ro].p=min(t[ro<<1].p,t[ro<<1|1].p);
}
int ques(int ro,int l,int r)
{
	if(t[ro].l==l&&t[ro].r==r)
		return t[ro].p;
	int mid=(t[ro].l+t[ro].r)>>1;
	if(r<=mid)
		return ques(ro<<1,l,r);
	else if(l>mid)
		return ques(ro<<1|1,l,r);
	else
		return min(ques(ro<<1,l,mid),ques(ro<<1|1,mid+1,r));
}
void add(int u,int v)
{//cerr<<u<<" "<<v<<endl;
	cnt++;
	e[cnt].ne=h[u];
	e[cnt].to=v;
	d[v]++;
	h[u]=cnt;
}
int main()
{
	n=read(),k=read();
	for(int i=1;i<=n;i++)
		a[i]=read(),p[a[i]]=i;
	build(1,1,n);
	for(int i=n;i>=1;i--)
	{
		int x=ques(1,p[i],min(n,p[i]+k-1)),y=ques(1,max(1,p[i]-k+1),p[i]);
		if(x<=n)
			add(p[i],p[x]);
		if(y<=n)
			add(p[i],p[y]);
		update(1,p[i],i);
	}
	priority_queue<int,vector<int>,greater<int> >q;
	for(int i=1;i<=n;i++)
		if(!d[i])
			q.push(i);
	while(!q.empty())
	{
		int u=q.top();
		p[++tot]=u;
		q.pop();
		for(int i=h[u];i;i=e[i].ne)
			if(!(--d[e[i].to]))
				q.push(e[i].to);
	}
	for(int i=1;i<=n;i++)
		a[p[i]]=i;
	for(int i=1;i<=n;i++)
		printf("%d\n",a[i]);
	return 0;
}