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 2000010
int mn[N],d[N],h[N],v[N*2],nxt[N*2],ec,ans[N],ct,n,k,a[N],p[N];
void add(int x,int y){v[++ec]=y;nxt[ec]=h[x];h[x]=ec;}
void bd(int o,int l,int r){
	mn[o]=1e9;
	if(l==r)return;
	int md=(l+r)/2;
	bd(o*2,l,md);
	bd(o*2+1,md+1,r);
}
void mod(int o,int l,int r,int x,int y){
	if(l==r){
		mn[o]=y;
		return;
	}
	int md=(l+r)/2;
	if(x<=md)mod(o*2,l,md,x,y);
	else mod(o*2+1,md+1,r,x,y);
	mn[o]=min(mn[o*2],mn[o*2+1]);	
}
int q(int o,int l,int r,int x,int y){
	if(r<x||y<l)return 1e9;
	if(x<=l&&r<=y)return mn[o];
	int md=(l+r)/2;
	return min(q(o*2,l,md,x,y),q(o*2+1,md+1,r,x,y));
}
priority_queue<int>qu;
void tp(){
	for(int i=1;i<=n;i++)
		for(int j=h[i];j;j=nxt[j])
			d[v[j]]++;
	for(int i=1;i<=n;i++)
		if(!d[i])qu.push(i);
	while(!qu.empty()){
		int x=qu.top();
		qu.pop();
		ans[++ct]=x;
		for(int i=h[x];i;i=nxt[i]){
			d[v[i]]--;
			if(!d[v[i]])qu.push(v[i]);
		}
	}
}
int main(){
	cin>>n>>k;
	for(int i=1;i<=n;i++){
		int x;
		scanf("%d",&x);
		a[x]=i;
	}
	reverse(a+1,a+n+1);
	bd(1,1,n);
	for(int i=n;i;i--){
		int x=q(1,1,n,max(1,a[i]-k+1),a[i]);
		if(x>0&&x<=n)add(a[i],a[x]);
		x=q(1,1,n,a[i],min(n,a[i]+k-1));
		if(x>0&&x<=n)add(a[i],a[x]);
		mod(1,1,n,a[i],i);
	}
	tp();
	reverse(ans+1,ans+n+1);
	for(int i=1;i<=n;i++)p[ans[i]]=i;
	for(int i=1;i<=n;i++)
		printf("%d\n",p[i]);
}