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;
template<class T> inline bool chkmax(T& a,T b){return a<b?a=b,1:0;}
template<class T> inline bool chkmin(T& a,T b){return a>b?a=b,1:0;}
template<typename T> inline T& read(T& x){
	static char c; bool flag=0;
	while(!isdigit(c=getchar())) if(c=='-') flag=1;
	for(x=c-'0';isdigit(c=getchar());(x*=10)+=c-'0');
	if(flag) x=-x;
	return x;
}
const int maxn=500010;
int n,k,t[maxn],p[maxn],ind[maxn];
int head[maxn],nxt[maxn],to[maxn],e;
void ae(int x,int y){
	to[++e]=y; nxt[e]=head[x]; head[x]=e;
}
namespace SGT{
#define ls h<<1
#define rs h<<1|1
#define mid ((l+r)>>1)
#define lc l,mid
#define rc mid+1,r
	int T[maxn*3];
	void pushup(int h){
		T[h]=max(T[ls],T[rs]);
	}
	void update(int h,int l,int r,int p,int x){
		if(l==r){T[h]=x; return;}
		if(p<=mid) update(ls,lc,p,x);
		else update(rs,rc,p,x);
		pushup(h);
	}
	int query(int h,int l,int r,int L,int R){
		if(L<=l&&r<=R) return T[h];
		int ret=0;
		if(L<=mid) chkmax(ret,query(ls,lc,L,R));
		if(R>mid) chkmax(ret,query(rs,rc,L,R));
		return ret;
	}
}
using namespace SGT;
priority_queue<int,vector<int>,greater<int> > q;
int main(){
	read(n); read(k);
	for(int i=1;i<=n;i++) t[read(p[i])]=i;
	for(int i=1;i<=n;i++){
		int pre=query(1,1,n,t[i]+1,t[i]+k-1);
		update(1,1,n,t[i],i);
		if(pre) ae(t[pre],t[i]),++ind[t[i]];
	}
	for(int i=1;i<=n;i++) if(!ind[i]) q.push(i);
	for(int i=1;i<=n;i++){
		int u=q.top(); q.pop();
		t[i]=u;
		for(int j=head[u];j;j=nxt[j]){
			int v=to[j];
			if(!--ind[v]) q.push(v);
		}
	}
	for(int i=1;i<=n;i++) p[t[i]]=i;
	for(int i=1;i<=n;i++) printf("%d\n",p[i]);
	return 0;
}
