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>
using namespace std;
const int maxn=500005,maxe=maxn<<1;
int n,K,p[maxn],q[maxn],ans[maxn];
int e,lnk[maxn],nxt[maxe],son[maxe],num[maxn];
inline char nc(){
	static char buf[100000],*p1,*p2;
	return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
}
inline int read(){
	int ret=0;bool f=0;char ch=nc();
	while(ch>'9'||ch<'0') f^=ch=='-',ch=nc();
	while(ch<='9'&&ch>='0') ret=ret*10+ch-'0',ch=nc();
	return f?-ret:ret;
}
inline void add_e(int x,int y){son[++e]=y;nxt[e]=lnk[x];lnk[x]=e;num[y]++;}
struct ST{
#define mid (L+R>>1)
#define ls (rt<<1)
#define rs (ls|1)
	int sum[maxn];
	inline void add(int L,int R,int rt,int x,int y){
		sum[rt]+=y;if(L==R) return;
		if(x<=mid) add(L,mid,ls,x,y);
		else add(mid+1,R,rs,x,y);
	}
	inline int getl(int L,int R,int rt,int x){
		if(L>x||!sum[rt]) return 0;
		if(L==R) return L;
		int now=getl(mid+1,R,rs,x);
		return now?now:getl(L,mid,ls,x);
	}
	inline int getr(int L,int R,int rt,int x){
		if(R<x||!sum[rt]) return 0;
		if(L==R) return L;
		int now=getr(L,mid,ls,x);
		return now?now:getr(mid+1,R,rs,x);
	}
}T;
inline void swap(int&x,int&y){int t=x;x=y;y=t;}
struct HP{
	int h[maxn],len;
	inline void add(int x){
		h[++len]=x;
		for (int i=len;i>1;i>>=1)
		if(h[i]>h[i>>1]) swap(h[i],h[i>>1]);else break;
	}
	inline int get(){
		int ret=h[1];h[1]=h[len--];
		for (int i=1,j;(i<<1)<=len;i=j){
			j=(i<<1)==len||h[(i<<1)]>h[(i<<1|1)]?(i<<1):(i<<1|1);
			if(h[j]>h[i]) swap(h[i],h[j]);else break;
		}
		return ret;
	}
}S;
int main(){
	n=read(),K=read();
	for (int i=1;i<=n;i++) p[i]=read(),q[p[i]]=i;
	for (int i=1;i<=n;i++){
		if(i-K>0) T.add(1,n,1,p[i-K],-1);
		int l=T.getl(1,n,1,p[i]),r=T.getr(1,n,1,p[i]);
		if(l) add_e(i,q[l]);
		if(r) add_e(q[r],i);
		T.add(1,n,1,p[i],1);
	}
	for (int i=1;i<=n;i++) if(!num[i]) S.add(i);
	for (int i=n;i;i--){
		int x=S.get();ans[x]=i;
		for (int j=lnk[x];j;j=nxt[j])
		if(!--num[son[j]]) S.add(son[j]);
	}
	for (int i=1;i<=n;i++) printf("%d\n",ans[i]);
	return 0;
}