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>
const int N=500010;
using namespace std;
int head[N],tot=0,a[N],n,pos[N],ans[N],k,cnt=-1;
vector<int>G[N];
int maxv[N<<2];
#define lson (o<<1)
#define rson (o<<1|1)
inline void pushup(int o){maxv[o]=max(maxv[lson],maxv[rson]);}
inline void change(int o,int l,int r,int q,int v){
	if(l==r)return void(maxv[o]=v);
	int mid=(l+r)>>1;
	if(q<=mid)change(lson,l,mid,q,v);
	if(q>mid)change(rson,mid+1,r,q,v);
	pushup(o);
}
inline int query(int o,int l,int r,int ql,int qr){
	if(ql<=l&&r<=qr)return maxv[o];
	int mid=(l+r)>>1,ans=0;
	if(ql<=mid)ans=max(ans,query(lson,l,mid,ql,qr));
	if(qr>mid)ans=max(ans,query(rson,mid+1,r,ql,qr));
	return ans;
}
inline int read(){
	int f=1,x=0;char ch;
	do{ch=getchar();if(ch=='-')f=-1;}while(ch<'0'||ch>'9');
	do{x=x*10+ch-'0';ch=getchar();}while(ch>='0'&&ch<='9');
	return f*x;
}
inline void addedge(int u,int v){G[u].push_back(v);}
inline void dfs(int u){
	ans[++cnt]=u;
	sort(G[u].begin(),G[u].end());
	for(int i=0;i<G[u].size();i++){
		int v=G[u][i];
		dfs(v);
	}
}
int main(){
	n=read();k=read();
	for(int i=1;i<=n;i++)a[i]=read(),pos[a[i]]=i;
	pos[n+1]=n+1;
	for(int i=1;i<=n;i++){
		int pre=query(1,1,n,pos[i]+1,pos[i]+k-1);
		if(!pre)pre=n+1;
		addedge(pos[pre],pos[i]);
		change(1,1,n,pos[i],i);
	}
	dfs(n+1);
	for(int i=1;i<=n;i++)a[ans[i]]=i;
	for(int i=1;i<=n;i++)printf("%d\n",a[i]);
	return 0;
}