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 rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << x << endl
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){return o<<"("<<p.fs<<","<<p.sc<<")";}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){o<<"sz = "<<vc.size()<<endl<<"[";for(const T& v:vc) o<<v<<",";o<<"]";return o;}

const int MN=500000;
int N,K;
int a[MN],b[MN];
vector<int> G[MN];
int deg[MN];
int ans[MN];

void add_edge(int a,int b){
//	printf("%d->%d\n",a,b);
	G[a].pb(b);
	deg[b]++;
}
int main(){
	cin>>N>>K;
	rep(i,N){
		cin>>a[i];
		a[i]--;
		b[a[i]]=i;
	}
	typedef pair<int,int> P;
	set<P> st;
	rep(i,N){
		P p(a[i],i);
		st.insert(p);
		if(i>=K){
			st.erase(P(a[i-K],i-K));
		}
		auto it = st.lower_bound(p);
		if(it!=st.begin()){
			it--;
			int l = it->sc;
			add_edge(i,l);
			it++;
		}
		it++;
		if(it!=st.end()){
			int r = it->sc;
			add_edge(r,i);
		}
	}
	priority_queue<int> que;
	rep(i,N) if(deg[i]==0) que.push(i);
	rep(t,N){
		int v = que.top();que.pop();
		ans[v]=N-1-t;
		for(int u:G[v]){
			deg[u]--;
			if(deg[u]==0) que.push(u);
		}
	}
	rep(i,N) cout<<ans[i]+1<<endl;
}
