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<cctype>
#include<queue>
#include<set>
#define N 500005
#define For(i,j,k) for(int i=j;i<=k;i++)
using namespace std;
int read(){
	int x=0,l=1; char ch=getchar();
	while(!isdigit(ch)) {if (ch=='-') l=-1; ch=getchar();}
	while(isdigit(ch)) x=x*10+(ch^48),ch=getchar();
	return x*l;
}
int l,pi[10];
void write(int x){
	l=0;
	while(x>0) pi[++l]=x%10,x=x/10;
	while(l) putchar(48+pi[l--]); putchar(10);
}
struct node{
	int key,pos;
	friend bool operator < (node a,node b){
		return a.key<b.key;
	}
};
int ans[N],a[N],v[N<<1],in[N],cnt,head[N],nex[N<<1];
void add(int x,int y){
	in[y]++; v[++cnt]=y; nex[cnt]=head[x]; head[x]=cnt;
}
int main(){
	int now=0,n=read(),k=read();
	For(i,1,n) a[i]=read();
	set<node> st; set<node>::iterator it;
	For(i,1,n){
		if (i>=k+1) st.erase((node){a[i-k],i-k});
		it=st.upper_bound((node){a[i],i});
		if (it!=st.end()) add(i,(*it).pos);
		st.insert((node){a[i],i});
	}
	st.clear();
	For(i,1,k-1) st.insert((node){a[i],i});
	For(i,1,n){
		st.erase((node){a[i],i});
		if (i+k-1<=n) st.insert((node){a[i+k-1],i+k-1});
		it=st.upper_bound((node){a[i],i});
		if (it!=st.end()) add(i,(*it).pos);
		st.erase((node){a[i-k+1]});
	}
	priority_queue<int,vector<int>,greater<int> > q;
	For(i,1,n) if (!in[i]) q.push(i);
	while(!q.empty()){
		int u=q.top(); q.pop();
		ans[u]=++now;
		for(int i=head[u];i;i=nex[i]){
			--in[v[i]];
			if (!in[v[i]]) q.push(v[i]);
		}
	}
	For(i,1,n) write(*(ans+i));
	return 0;
}