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 pii pair<int,int>
#define se second
#define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++)
using namespace std;
const int N=500005;
int deg[N],p[N],q[N],n,k;
int ans[N],mx[N*4];
priority_queue<pii,vector<pii >,greater<pii > > que;
vector<int> e[N];
void change(int k,int l,int r,int p,int v){
	mx[k]=max(mx[k],v);
	if (l==r) return;
	int mid=(l+r)/2;
	if (p<=mid) change(k*2,l,mid,p,v);
	else change(k*2+1,mid+1,r,p,v);
}
int ask(int k,int l,int r,int x,int y){
	if (x>y) return 0;
	if (l==x&&r==y) return mx[k];
	int mid=(l+r)/2;
	if (y<=mid) return ask(k*2,l,mid,x,y);
	if (x>mid) return ask(k*2+1,mid+1,r,x,y);
	return max(ask(k*2,l,mid,x,mid),
			   ask(k*2+1,mid+1,r,mid+1,y));
}
int main(){
	scanf("%d%d",&n,&k);
	For(i,1,n) scanf("%d",&p[i]),q[p[i]]=i;
	For(i,1,n){
		int v=ask(1,1,n,q[i]+1,min(n,q[i]+k-1));
		if (v) e[v].push_back(i),deg[i]=1;
		else que.push(pii(q[i],i));
		change(1,1,n,q[i],i);
	}
	while (!que.empty()){
		int x=que.top().se; que.pop();
		for (int i:e[x]) que.push(pii(q[i],i));
		ans[++*ans]=x;
	}
	For(i,1,*ans) p[q[ans[i]]]=i;
	For(i,1,n) printf("%d\n",p[i]);
}