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 fo(i,a,b) for(i=a;i<=b;i++)
#define fd(i,a,b) for(i=a;i>=b;i--)
#define min(a,b) (a<b?a:b)
#define max(a,b) (a>b?a:b)
typedef long long ll;
const int maxn=5e5+5;
using namespace std;
int q[maxn],p[maxn],k,i,j,n,inf,y,a[maxn],d[maxn];
int l[maxn],r[maxn],tree[maxn<<2],now;
struct ar{int x,y;};
bool operator <(ar a,ar b){
	return a.y==b.y?a.x<b.x:a.y<b.y;
}
set<ar>w;
inline int read(){
	int n=0;char c=getchar();
	for(;c<'0'||c>'9';c=getchar());
	for(;c>='0'&&c<='9';c=getchar()) n=n*10+c-48;
	return n;
}
void find(int k,int l,int r,int a,int b){
	if (now<=tree[k]) return;
	if (l==a&&r==b) {
		now=tree[k];
		return;
	}
	int m=(l+r)>>1;
	if (b<=m) find(k<<1,l,m,a,b);else
	if (a>m) find(k<<1|1,m+1,r,a,b);else
	find(k<<1,l,m,a,m),find(k<<1|1,m+1,r,m+1,b);
}
void ins(int k,int l,int r,int x){
	tree[k]=min(tree[k],y);
	if (l==r)return;
	int m=(l+r)>>1;
	if (x<=m) ins(k<<1,l,m,x);else
	ins(k<<1|1,m+1,r,x);
}
int main(){
	n=read(),k=read();
	fo(i,1,n) p[i]=read(),q[p[i]]=i;
	memset(tree,127/3,sizeof(tree));
	inf=tree[0];
	fd(i,n,1){
		int x=q[i];
		now=inf,find(1,1,n,max(1,x-k+1),x);
		if (now!=inf) l[x]=q[now],d[l[x]]++;
		now=inf,find(1,1,n,x,min(x+k-1,n));
		if (now!=inf) r[x]=q[now],d[r[x]]++;
		y=i,ins(1,1,n,x);
	}
	fo(i,1,n) w.insert((ar){i,d[i]});
	fo(i,1,n) {
		ar now=*w.begin();
		w.erase(w.begin());
		a[i]=now.x;
		if (i==n) continue;
		if (l[now.x]) {
			int x=l[now.x];
			w.erase(w.find((ar){x,d[x]}));
			d[x]--;
			w.insert((ar){x,d[x]});
		}
		if (r[now.x]) {
			int x=r[now.x];
			w.erase(w.find((ar){x,d[x]}));
			d[x]--;
			w.insert((ar){x,d[x]});
		}
	}
	fo(i,1,n) p[a[i]]=i;
	fo(i,1,n) printf("%d\n",p[i]);
}