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>
using namespace std;
const int N=1000005;
int f[N],a[N],l,b[N],tot,ne[N],fi[N],zz[N],in[N],ans[N],n,m;
struct Tree{
	int l,r,num;
}T[N*4];
void up(int x){
	if (x==1)return;
	if (b[f[x]]<b[f[x/2]]){
		swap(f[x],f[x/2]);
		up(x/2);
	}
}
void down(int x){
	int i=x;
	if (x*2<=l&&b[f[x]]>b[f[x*2]])i=x*2;
	if (x*2<l&&b[f[i]]>b[f[x*2+1]])i=x*2+1;
	if (i!=x){
		swap(f[x],f[i]);
		down(i);
	}
}
void build(int x,int l,int r){
	T[x].l=l;T[x].r=r;T[x].num=n+1;
	if (T[x].l==T[x].r)return;
	int mid=(l+r)/2;
	build(x*2,l,mid);
	build(x*2+1,mid+1,r);
}
void insert(int x,int y,int z){
	T[x].num=min(T[x].num,z);
	if (T[x].l==T[x].r)return;
	int mid=(T[x].l+T[x].r)/2;
	if (y<=mid)insert(x*2,y,z);
	else insert(x*2+1,y,z);
}
int find(int x,int l,int r){
	if (T[x].l>r||l>T[x].r)return n+1;
	if (T[x].l>=l&&T[x].r<=r)return T[x].num;
	return min(find(x*2,l,r),find(x*2+1,l,r));
}
void jb(int x,int y){
	ne[++tot]=fi[x];
	fi[x]=tot;
	zz[tot]=y;
	in[y]++;
}
int main(){
	scanf("%d%d",&n,&m);
	for (int i=1;i<=n;i++)scanf("%d",&a[i]),b[a[i]]=i;
	build(1,1,n);
	for (int i=n;i;i--){
		int k1=find(1,b[i]-m+1,b[i]),k2=find(1,b[i],b[i]+m-1);
		if (k1<=n)jb(i,k1);
		if (k2<=n)jb(i,k2);
		insert(1,b[i],i);
	}
	for (int i=1;i<=n;i++)
		if (!in[i])f[++l]=i,up(l);
	for (int i=1;i<=n;i++){
		int k=f[1];f[1]=f[l--];down(1);
		ans[b[k]]=i;
		for (int j=fi[k];j;j=ne[j]){
			in[zz[j]]--;
			if (!in[zz[j]])f[++l]=zz[j],up(l);
		}
	} 
	for (int i=1;i<=n;i++)printf("%d\n",ans[i]);
	return 0;
}