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>
using namespace std;

const int mn = 5e5+10;

int p[mn],q[mn],val[mn<<2],ans[mn];

#define ls idx<<1
#define rs idx<<1|1

void build(int idx,int l,int r){
	if(l==r){
		val[idx]=p[l];
		return;
	}
	int mid=(l+r)>>1;
	build(ls,l,mid);build(rs,mid+1,r);
	val[idx]=max(val[ls],val[rs]);
}

void update(int idx,int l,int r,int p,int v){
	if(l==r){
		val[idx]=v;
		return;
	}
	int mid = (l+r)>>1;
	if(p<=mid)
		update(ls,l,mid,p,v);
	else
		update(rs,mid+1,r,p,v);
	val[idx]=max(val[ls],val[rs]);
}

int query(int idx,int l,int r,int L,int R){
	if(L<=l&&r<=R)
		return val[idx];
	if(R<l||r<L)
		return -1;
	int mid=(l+r)>>1;
	return max(query(ls,l,mid,L,R),query(rs,mid+1,r,L,R));
}

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n,k;
	cin>>n>>k;
	for(int i=1;i<=n;i++){
		cin>>p[i];
		q[p[i]]=i;
	}
	build(1,1,n);
	priority_queue<int> pq;

	for(int i=1;i<=n;i++)
		if(query(1,1,n,max(1,i-k+1),min(n,i+k-1))==p[i])
			pq.emplace(i);
	for(int i=n;i>=1;i--){
		int x=pq.top();pq.pop();
		ans[x]=i;
		update(1,1,n,x,-1);
		int nr=query(1,1,n,x,min(n,x+k-1)),nl=query(1,1,n,max(1,x-k+1),x);
		if(nr!=-1&&query(1,1,n,max(1,q[nr]-k+1),min(q[nr]+k-1,n))==nr)
			pq.emplace(q[nr]);
		if(nl!=-1&&query(1,1,n,max(1,q[nl]-k+1),min(q[nl]+k-1,n))==nl)
			pq.emplace(q[nl]);
	}
	for(int i=1;i<=n;i++)
		cout<<ans[i]<<'\n';
}
