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<algorithm>
#include<vector>
#include<queue>
#define MAXN 500000
using namespace std;
priority_queue<int,vector<int>,greater<int> > que;
int N,K;
int p[MAXN+5],q[MAXN+5];
int tree[MAXN*4],d[MAXN+5];
vector<int> G[MAXN+5],ans;
void Build(int i,int l,int r)
{
	tree[i]=0;
	if(l==r)
		return;
	int mid=(l+r)/2;
	Build(i*2,l,mid);
	Build(i*2+1,mid+1,r);
}
void PushUp(int i)
{
	tree[i]=max(tree[i*2],tree[i*2+1]);
}
void Insert(int i,int l,int r,int p,int val)
{
	if(l==r)
	{
		tree[i]=val;
		return;
	}
	int mid=(l+r)/2;
	if(p<=mid)
		Insert(i*2,l,mid,p,val);
	else
		Insert(i*2+1,mid+1,r,p,val);
	PushUp(i);
}
int Query(int i,int l,int r,int ql,int qr)
{
	if(qr<l||ql>r)
		return 0;
	if(ql<=l&&r<=qr)
		return tree[i];
	int mid=(l+r)/2;
	return max(Query(i*2,l,mid,ql,qr),Query(i*2+1,mid+1,r,ql,qr));
}
void BFS()
{
	for(int i=1;i<=N;i++)
		if(d[i]==0)
			que.push(i);
	while(que.empty()==false)
	{
		int u=que.top();
		que.pop();
		ans.push_back(u);
		for(int i=0;i<(int)G[u].size();i++)
		{
			int v=G[u][i];
			d[v]--;
			if(d[v]==0)
				que.push(v);
		}
	}
}
int main()
{
//	freopen("swap.in","r",stdin);
//	freopen("swap.out","w",stdout);
	scanf("%d %d",&N,&K);
	for(int i=1;i<=N;i++)
	{
		scanf("%d",&p[i]);
		q[p[i]]=i;
	}
	Build(1,1,N);
	for(int i=1;i<=N;i++)
	{
		int pos=Query(1,1,N,max(q[i]-K+1,1),q[i]);
		if(pos!=0)
		{
			G[q[pos]].push_back(q[i]);
			d[q[i]]++;
		}
		pos=Query(1,1,N,q[i],min(N,q[i]+K-1));
		if(pos!=0)
		{
			G[q[pos]].push_back(q[i]);
			d[q[i]]++;
		}
		Insert(1,1,N,q[i],i);
	}
	for(int i=1;i<=N;i++)
		sort(G[i].begin(),G[i].end());
	BFS();
	for(int i=0;i<(int)ans.size();i++)
		p[ans[i]]=i+1;
	for(int i=1;i<=N;i++)
		printf("%d\n",p[i]);
	return 0;
}