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 inf 1000000000
#define N 2000005
using namespace std;
int n,K,kk,cnt,a[N],p[N],d[N],head[N],val[N],ru[N];
struct Edge{int nxt,to;}e[N];
inline void link(int x,int y){ru[y]++;e[++kk].nxt=head[x];e[kk].to=y;head[x]=kk;}
void insert(int k,int l,int r,int x,int y){
	if (l==r){d[k]=y;return;}
	int mid=(l+r)>>1;
	if (x<=mid) insert(k*2,l,mid,x,y);
	else insert(k*2+1,mid+1,r,x,y);
	d[k]=max(d[k*2],d[k*2+1]);
}
int query1(int k,int l,int r,int x,int y){
	if (x>y) return 0;
	if (x<=l&&y>=r) return d[k];
	int mid=(l+r)>>1;
	if (y<=mid) return query1(k*2,l,mid,x,y);
	else if (x>mid) return query1(k*2+1,mid+1,r,x,y);
	else return max(query1(k*2,l,mid,x,mid),query1(k*2+1,mid+1,r,mid+1,y));
}
priority_queue<int> Q;
inline void topsort(){
	for (int i=1;i<=n;i++) if (!ru[i]) Q.push(-i);
	while (!Q.empty()){
		int u=-Q.top();Q.pop();
		cnt++;val[u]=cnt;
		for (int i=head[u];i;i=e[i].nxt){
			int v=e[i].to;ru[v]--;
			if (!ru[v]) Q.push(-v);
		}
	}
}
int main(){
	scanf("%d%d",&n,&K);
	for (int i=1;i<=n;i++) scanf("%d",&a[i]);
	for (int i=1;i<=n;i++) p[a[i]]=i;
	for (int i=1;i<=n;i++){
		int pos1=query1(1,1,n,min(n,p[i]+1),min(n,p[i]+K-1));
		if (pos1) link(p[pos1],p[i]);
		pos1=query1(1,1,n,max(1,p[i]-K+1),max(1,p[i]-1));
		if (pos1) link(p[pos1],p[i]);
		insert(1,1,n,p[i],i);
	}
	topsort();
	for (int i=1;i<=n;i++) printf("%d\n",val[i]);
	return 0;
}