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<iostream>
#include<cstdio>
#include<cstring>
#include<queue>
#define M 500010
#define ls node<<1
#define rs node<<1|1
#define inf 1e9
using namespace std;
int n,num,k,cnt;
int p[M],a[M],dig[M],ans[M],head[M],val[M<<2];
struct edge{int next,to;}e[M<<1];
void add(int from,int to) {
	e[++num]=(edge){head[from],to};
	head[from]=num;
}
priority_queue<int,vector<int>,greater<int> >Q;
void build(int node,int l,int r) {
	val[node]=inf;
	if(l==r) return;
	int mid=(l+r)>>1;
	build(ls,l,mid);
	build(rs,mid+1,r);
}
void change(int node,int l,int r,int p,int v) {
	val[node]=min(val[node],v);
	if(l==r) return;
	int mid=(l+r)>>1;
	if(p<=mid) change(ls,l,mid,p,v);
	else change(rs,mid+1,r,p,v);
}
int query(int node,int l,int r,int l1,int r1) {
	if(l1>r1) return inf;
	if(l1<=l&&r1>=r) return val[node];
	int mid=(l+r)>>1,ans=inf;
	if(l1<=mid) ans=min(ans,query(ls,l,mid,l1,r1));
	if(r1>mid) ans=min(ans,query(rs,mid+1,r,l1,r1));
	return ans;
}
int main() {
	scanf("%d%d",&n,&k);
	for(int i=1;i<=n;i++) scanf("%d",&p[i]);
	for(int i=1;i<=n;i++) a[p[i]]=i;
	build(1,1,n);
	for(int i=n;i>=1;i--) {
		int res;
		res=query(1,1,n,max(1,a[i]-k+1),a[i]-1);
		if(res!=inf) add(a[i],a[res]),dig[a[res]]++;
		res=query(1,1,n,a[i]+1,min(a[i]+k-1,n));
		if(res!=inf) add(a[i],a[res]),dig[a[res]]++;
		change(1,1,n,a[i],i);
	}
	for(int i=1;i<=n;i++) 
		if(!dig[i]) Q.push(i);
	while(!Q.empty()) {
		int x=Q.top();Q.pop();ans[x]=++cnt;
		for(int i=head[x];i;i=e[i].next) {
			int to=e[i].to;
			if((--dig[to])==0)
				Q.push(to); 
		}
	}
	for(int i=1;i<=cnt;i++) printf("%d\n",ans[i]);
	return 0;
}