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;

int read(){
	int a = 0; char c = getchar(); while(!isdigit(c)) c = getchar();
	while(isdigit(c)){a = a * 10 + c - 48; c = getchar();} return a;
}

const int _ = 2e6 + 7;
int N , K , P[_] , tmp[_]; priority_queue < int > q;

#define mid ((l + r) >> 1)
#define lch (x << 1)
#define rch (x << 1 | 1)
int mn[_] , mrk[_];
void mark(int x , int v){mn[x] += v; mrk[x] += v;}
void down(int x){if(mrk[x]){mark(lch , mrk[x]); mark(rch , mrk[x]); mrk[x] = 0;}}

void ins(int x , int l , int r , int t){
	if(l == r){mn[x] = 0; return;}
	down(x); mn[x] = 0; mid >= t ? ins(lch , l , mid , t) : ins(rch , mid + 1 , r , t);
}

void add(int x , int l , int r , int L , int R , int v){
	if(l >= L && r <= R) return mark(x , v);
	down(x);
	if(mid >= L) add(lch , l , mid , L , R , v);
	if(mid < R) add(rch , mid + 1 , r , L , R , v);
	mn[x] = min(mn[lch] , mn[rch]);
}

void find(int x , int l , int r){
	if(mn[x]) return;
	if(l == r){mn[x] = 1e9; q.push(l); return;}
	down(x); find(lch , l , mid); find(rch , mid + 1 , r); mn[x] = min(mn[lch] , mn[rch]);
}

int main(){
	N = read(); K = read(); for(int i = 1 ; i <= N ; ++i) P[read()] = i;
	for(int i = 1 ; i <= N ; ++i){
		add(1 , 1 , N , max(1 , P[i] - K + 1) , min(N , P[i] + K - 1) , 1);	ins(1 , 1 , N , P[i]);
	}
	find(1 , 1 , N); vector < int > ans;
	while(!q.empty()){
		int t = q.top(); q.pop(); ans.push_back(t);
		add(1 , 1 , N , max(1 , t - K + 1) , min(N , t + K - 1) , -1); find(1 , 1 , N);
	}
	reverse(ans.begin() , ans.end());
	for(int i = 0 ; i < ans.size() ; ++i) P[ans[i]] = i + 1;
	for(int i = 1 ; i <= N ; ++i) printf("%d\n" , P[i]);
	return 0;
}