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 ls (u<<1)
#define rs (u<<1|1)
#define mid ((l+r)>>1)
using namespace std;
int n,m;
struct node{
	int next,to;
}a[1500005];
int head[500005],cnt,v[500005],p[500005],minn[2000005],da[500005];
void add(int e,int r){
	a[++cnt].next=head[e];a[cnt].to=r;head[e]=cnt;
}
priority_queue<int>q;
inline int read(){
	char c=getchar();int s=0;
	while(c<'0'||c>'9')c=getchar();
	while(c>='0'&&c<='9'){
		s=s*10+c-'0';c=getchar();
	}return s;
}
inline void update(int u){
	if(v[minn[ls]]>v[minn[rs]])minn[u]=minn[ls];
	else minn[u]=minn[rs];
}
void build(int u,int l,int r){
	if(l==r){return (void)(minn[u]=l);}
	build(ls,l,mid);
	build(rs,mid+1,r);
	update(u);
}
void add(int u,int l,int r,int x){
	if(l==r){return (void)(minn[u]=0);}
	if(x<=mid)add(ls,l,mid,x);
	else add(rs,mid+1,r,x);
	update(u);
}
int query(int u,int l,int r,int L,int R){
	if(L>R)return 0;
	if(L<=l&&R>=r){return minn[u];}
	int jly=0;
	int jlx=0;
	if(L<=mid)jlx=query(ls,l,mid,L,R);
	if(R>mid)jly=query(rs,mid+1,r,L,R);
	if(v[jlx]>v[jly])return jlx;
	else return jly;
}
int bj[500005];
void pd(int u){
	if(bj[u])return ;
	if(query(1,1,n,max(1,u-m+1),min(u+m-1,n))==u)return (void)(q.push(u),bj[u]=1);
}
int main(){
	n=read();m=read();
	for(int i=1;i<=n;i++)v[i]=read();
	build(1,1,n);minn[0]=-19191981;bj[0]=1;
	for(int i=n;i>=1;i--){
		pd(i);
	}
	for(int i=n;i>=1;i--){
		int u=q.top();
		q.pop();
		add(1,1,n,u);
		da[u]=i;
		int x=query(1,1,n,max(1,u-m+1),u-1);
		pd(x);
		int y=query(1,1,n,u+1,min(u+m-1,n));
		pd(y);
	}
	for(int i=1;i<=n;i++){
		printf("%d\n",da[i]);
	}
}