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<algorithm>
#include<queue>
#include<cstring>
#include<iostream>
#include<cstdio>
#include<cmath>
#include<map>
using namespace std;
#define N 500005
#define INF 0x3f3f3f3f
#define LL long long
int rd()
{
	int x=0,f=1;char c=getchar();
	while(c<'0'||c>'9'){if(c=='-')f=-1; c=getchar();}
	while(c>='0'&&c<='9'){x=(x<<3)+(x<<1)+(c^48); c=getchar();}
	return f*x;
}
priority_queue<int,vector<int>,greater<int> > Q;//小根堆 保证字典序最小 
int n,k,m;
int ind[N];
vector<int>G[N];
int q[N],ans[N];
int tree[N<<2];
//权值线段树 维护区间最小值(因为是从右到左 就是离他最近 
void PushUp(int i)
{
	tree[i]=min(tree[i<<1],tree[i<<1|1]);
}
void Update(int i,int l,int r,int pos,int val)
{
	if(l==r)
	{
		tree[i]=val;
		return ;
	}
	int mid=(l+r)>>1;
	if(pos<=mid) Update(i<<1,l,mid,pos,val);
	else Update(i<<1|1,mid+1,r,pos,val);
	PushUp(i);
}
int Query(int i,int l,int r,int ql,int qr)
{
	if(r<ql||qr<l) return INF;
	if(ql<=l&&qr>=r) return tree[i];
	int mid=(l+r)>>1;
	return min(Query(i<<1,l,mid,ql,qr),Query(i<<1|1,mid+1,r,ql,qr));
} 
void Topo()
{
	for(int i=1;i<=n;i++)
		if(!ind[i]) Q.push(i);
	while(!Q.empty())
	{
		int u=Q.top(); Q.pop();
		q[++m]=u;
		for(int i=0;i<G[u].size();i++)
		{
			int v=G[u][i];
			ind[v]--;
			if(!ind[v]) Q.push(v);
		}
	}
}
int main()
{
	memset(tree,INF,sizeof(tree));
	n=rd(),k=rd();
	for(int i=1;i<=n;i++)
		q[rd()]=i;
	for(int i=n;i>=1;i--)
	{
		int j=Query(1,1,n,q[i]+1,q[i]+k-1);//q[j]-q[i]<k
		if(j!=INF) ind[q[j]]++,G[q[i]].push_back(q[j]);
		j=Query(1,1,n,q[i]-k+1,q[i]-1);//q[i]-q[j]<k
		if(j!=INF) ind[q[j]]++,G[q[i]].push_back(q[j]);
		Update(1,1,n,q[i],i);
	}
	Topo();
	for(int i=1;i<=n;i++)
		ans[q[i]]=i;
	for(int i=1;i<=n;i++)
		printf("%d\n",ans[i]);
	return 0;
}