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 <iostream>
#include <cstdio>

using namespace std;

const int MAX_N = (1 << 19);
const int INF = 1000000007;

int seg[2*MAX_N];

void init(){
	for(int i=0;i<2*MAX_N;++i) seg[i] = INF;
}

void update(int pos, int val){
	int idx = pos+MAX_N-1;
	seg[idx] = val;
	while(idx){
		idx = (idx-1)/2;
		seg[idx] = min(seg[2*idx+1], seg[2*idx+2]);
	}
}

int query(int l, int r, int idx = 0, int L = 0, int R = MAX_N){
	if(l <= L && R <= r) return seg[idx];
	if(r <= L || R <= l) return INF;
	int a = query(l, r, 2*idx+1, L, (L+R)/2);
	int b = query(l, r, 2*idx+2, (L+R)/2, R);
	return min(a, b);
}

int N, K;
int P[500000];
int res[500000];

void check(int i, int& r){
	if(P[i] == INF) return;
	while(true){
		int v = query(0, P[i]);
		if(v >= i+K) break;
		check(v, r);
	}
	res[i] = r++;
	update(P[i], INF);
	P[i] = INF;
}

int main(){
	while(cin >> N >> K){
		init();
		for(int i=0;i<N;i++){
			scanf("%d", &P[i]);
			--P[i];
			update(P[i], i);
		}
		int r = 1;
		for(int i=0;i<N;i++) check(i, r);
		for(int i=0;i<N;i++) printf("%d\n", res[i]);
	}
}
