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>
#define re register
#define inc(i,j,k) for(re int i=j;i<=k;i++)
#define dec(i,j,k) for(re int i=j;i>=k;i--)
#define lc o<<1
#define rc o<<1|1
const int N=5e5+5; 
using namespace std;
inline int read(){
	int x=0;
	char ch=getchar();
	while(ch<'0'||ch>'9') ch=getchar();
	while('0'<=ch&&ch<='9') x=x*10+ch-'0',ch=getchar();
	return x;
}
int n,k,p[N],maxx[N<<2],ans[N];
int gmax(int a,int b){return p[a]>p[b]?a:b;}
priority_queue<int> q;
bool in[N];
void build(int o,int l,int r){
	if(l==r) return maxx[o]=l,void();
	int mid=(l+r)>>1;
	build(lc,l,mid),build(rc,mid+1,r);
	maxx[o]=gmax(maxx[lc],maxx[rc]);
}
void del(int o,int l,int r,int x){
	if(l==r){p[l]=0;return;}
	int mid=(l+r)>>1;
	if(x<=mid) del(lc,l,mid,x);
	else del(rc,mid+1,r,x);
	maxx[o]=gmax(maxx[lc],maxx[rc]);
}
int query(int o,int l,int r,int x,int y){
	if(y<l||r<x) return 0;
	if(x<=l&&r<=y) return maxx[o];
	int mid=(l+r)>>1,res=0;
	if(x<=mid) res=gmax(res,query(lc,l,mid,x,y));
	if(mid<y) res=gmax(res,query(rc,mid+1,r,x,y));
	return res;
}
void putin(int x){
	if(in[x]) return;
	if(query(1,1,n,x-k+1,x+k-1)==x) q.push(x),in[x]=1;
}
int main(){
	n=read(),k=read();
	inc(i,1,n) p[i]=read();
	in[0]=1;build(1,1,n);
	inc(i,1,n) putin(i);
	dec(i,n,1){
		int u=q.top();q.pop();
		ans[u]=i;
		del(1,1,n,u);
		putin(query(1,1,n,u-k+1,u-1));
		putin(query(1,1,n,u+1,u+k-1));
	}
	inc(i,1,n) printf("%d\n",ans[i]);
}