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 MN 500000
#define N 524288
using namespace std;
inline int read()
{
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
int n,K,a[MN+5],t[N*2+5],b[MN+5],c[MN+5];
struct Tree{int l,r,val,x;}T[MN*3+5];
inline void Renew(int x,int v){for(t[x+=N]+=v;x>>=1;)t[x]=t[x<<1]+t[x<<1|1];}
inline int Query(int l,int r)
{
	int res=0;
	for(l+=N-1,r+=N+1;l^r^1;l>>=1,r>>=1)
	{
		if(~l&1) res+=t[l+1];
		if( r&1) res+=t[r-1]; 
	}
	return res;
}
void Build(int x,int l,int r)
{
	if((T[x].l=l)==(T[x].r=r)) {T[x].x=b[l];return;}
	int mid=l+r>>1;
	Build(x<<1,l,mid);Build(x<<1|1,mid+1,r);
	T[x].x=min(T[x<<1].x,T[x<<1|1].x);
}
inline void Mark(int x,int v){T[x].x+=v;T[x].val+=v;}
inline void pushdown(int x){if(T[x].val)Mark(x<<1,T[x].val),Mark(x<<1|1,T[x].val),T[x].val=0;}
int Find(int x)
{
	if(T[x].l==T[x].r) return T[x].l;
	pushdown(x);
	return Find(x<<1|(T[x<<1|1].x<=0));	
}
void Mod(int x,int l,int r,int v)
{
	if(T[x].l==l&&T[x].r==r) return Mark(x,v);
	int mid=T[x].l+T[x].r>>1;
	pushdown(x);
	if(r<=mid) Mod(x<<1,l,r,v);
	else if(l>mid) Mod(x<<1|1,l,r,v);
	else Mod(x<<1,l,mid,v),Mod(x<<1|1,mid+1,r,v);
	T[x].x=min(T[x<<1].x,T[x<<1|1].x);	
}
int main()
{
	n=read();K=read();
	for(int i=1;i<=n;++i) a[read()]=i;
	for(int i=n;i;--i) b[a[i]]=Query(max(1,a[i]-K+1),min(n,a[i]+K-1)),Renew(a[i],1);
	Build(1,1,n);
	for(int i=n;i;--i)
	{
		int x=Find(1);c[x]=i;
		Mod(1,x,x,1e6);Mod(1,max(1,x-K+1),min(n,x+K-1),-1);
	}
	for(int i=1;i<=n;++i) printf("%d\n",c[i]);
	return 0;
}

