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;

#define N 600000
#define ls (x<<1)
#define rs (x<<1|1)

int n,m,x,a[N],stk[N],f[N],L[N],R[N];
bool seg[N<<2];

void ins(int x,int y){
	if (!R[x]){R[x]=y; L[y]=x; return;}
	int z=R[x]; R[x]=y; L[z]=y; L[y]=x; R[y]=z;
}

void upd(int x){
	seg[x]=seg[ls]|seg[rs];
}

void clr(int x,int l,int r,int L,int R){
	if (!seg[x]||L>R) return;
	if (l==r){seg[x]=0; return;}
	int mid=(l+r)>>1;
	if (L<=mid) clr(ls,l,mid,L,R);
	if (R>mid) clr(rs,mid+1,r,L,R);
	upd(x);
}

void add(int x,int l,int r,int t){
	if (l==r){seg[x]=1; return;}
	int mid=(l+r)>>1;
	if (t<=mid) add(ls,l,mid,t);
	else add(rs,mid+1,r,t);
	upd(x);
}

int fd(int x,int l,int r,int R){
	if (!seg[x]) return 0;
	if (l==r) return l;
	int mid=(l+r)>>1,t=0;
	if (R>mid) t=fd(rs,mid+1,r,R);
	return t?t:fd(ls,l,mid,R);
}

int main(){
	scanf("%d%d",&n,&m);
	for (int i=1;i<=n;++i){scanf("%d",&x); a[x]=i;}
	add(1,0,n,0);
	for (int i=1;i<=n;++i){
		ins(fd(1,0,n,a[i]+m-1),a[i]);
		clr(1,0,n,a[i],a[i]+m-1);
		add(1,0,n,a[i]);
	}
	for (int i=R[0],j=1;j<=n;i=R[i],++j) f[i]=j;
	for (int i=1;i<=n;++i) printf("%d\n",f[i]);
	
	return 0;
}
			