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
//@winlere
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<queue>
#include<vector>

using namespace std;  typedef long long ll;
inline int qr(){
	int ret=0,f=0,c=getchar();
	while(!isdigit(c))f|=c==45,c=getchar();
	while(isdigit(c)) ret=ret*10+c-48,c=getchar();
	return f?-ret:ret;
}

const int maxn=5e5+5;
const int inf=0x3f3f3f3f;
vector<int> e[maxn];
int data[maxn],arc[maxn],dr[maxn],n,k;
int seg[maxn<<2],ans[maxn];
void pp(int pos){seg[pos]=min(seg[pos<<1],seg[pos<<1|1]);}
void add(int fr,int to){e[to].push_back(fr);++dr[fr];}

#define mid ((l+r)>>1)
#define lef l,mid,pos<<1
#define rgt mid+1,r,pos<<1|1
int que(int L,int R,int l,int r,int pos){
	if(L>r||R<l) return inf;
	if(L<=l&&r<=R) return seg[pos];
	return min(que(L,R,lef),que(L,R,rgt));
}
void upd(int p,int v,int l,int r,int pos){
	if(p<l||p>r) return;
	if(l==r) return seg[pos]=v,void();
	upd(p,v,lef); upd(p,v,rgt);
	pp(pos);
}
#undef mid
#undef lef
#undef rgt

int main(){
	n=qr(); k=qr();
	for(int t=1;t<=n;++t) data[t]=qr(),arc[data[t]]=t;
	memset(seg,0x3f,sizeof seg);
	for(int t=n;t;--t){
		int t1=que(arc[t]-k+1,arc[t]-1,1,n,1);
		int t2=que(arc[t]+1,arc[t]+k-1,1,n,1);
		if(t1<=n) add(arc[t],arc[t1]);
		if(t2<=n) add(arc[t],arc[t2]);
		upd(arc[t],t,1,n,1);
	}
	static priority_queue<int> q;
	for(int t=1;t<=n;++t)
		if(!dr[t]) q.push(t);
	int cnt=0;
	while(q.size()){
		int now=q.top();
		ans[now]=++cnt;
		q.pop();
		for(auto t:e[now])
			if(--dr[t]==0)
				q.push(t);//asdasd
	}
	for(int t=1;t<=n;++t) printf("%d\n",n-ans[t]+1);
	return 0;
}