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>

const int N=500005; 

using namespace std;

int n,m,mark,p[N],qq[N],deg[N];
pair<int,int> q[N];

struct edge{
	int u,v,nxt; 
}e[N<<1]; int adj[N],tail; 

void addedge(int u,int v){ e[++tail]=(edge){u,v,adj[u]}; adj[u]=tail; }

set<int> s; 
set<int>::iterator it; 
priority_queue< int, vector<int>, greater<int> > pq; 

bool cmp(pair<int,int> a, pair<int,int> b){ return a.first>b.first; }

int main(){
	int x,y; 
	scanf("%d%d",&n,&m); 
	for(int i=1; i<=n; ++i) scanf("%d",&p[i]);  
	for(int i=1; i<=n; ++i) qq[p[i]]=q[p[i]].first=i, q[p[i]].second=p[i]; 
	tail=0; for(int i=1; i<=n; ++i) adj[i]=-1; 
	sort(q+1,q+n+1); s.clear(); 
	for(int i=1; i<=n; ++i){
		if(i-m>=1) s.erase(q[i-m].second);
		it=s.upper_bound(q[i].second);
		if(it!=s.end()) addedge(q[i].first,qq[*it]), ++deg[qq[*it]]; 
 		s.insert(q[i].second); 
	}
	sort(q+1,q+n+1,cmp); s.clear(); 
	for(int i=1; i<=n; ++i){
		if(i-m>=1) s.erase(q[i-m].second);
		it=s.upper_bound(q[i].second);
		if(it!=s.end()) addedge(q[i].first,qq[*it]), ++deg[qq[*it]]; 
 		s.insert(q[i].second); 
	}
	for(int i=1; i<=n; ++i) if(!deg[i]) pq.push(i); 
	for(int i=1; i<=n; ++i){
		x=pq.top(); pq.pop(); 
		p[x]=i; 
		for(int k=adj[x]; k!=-1; k=e[k].nxt){
			y=e[k].v; 
			--deg[y]; 
			if(!deg[y]) pq.push(y); 
		}
	} 
	for(int i=1; i<=n; ++i) printf("%d\n",p[i]); 
	return 0; 
}