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<vector>
#include<queue>
#include<functional>
#include<algorithm>
#include<set>
#include<iostream>

using namespace std;

const int MX = 1<<19;
const int MM = 1000000007;

typedef long long ll;
typedef pair<int,int> pii;

struct Tree{
	pii t[MX*2];
	void update(int A[MX]){
		for(int i = 1; i < MX; i++) t[i+MX] = pii(A[i], i);
		for(int i = MX-1; i >= 1; i--){
			t[i] = min(t[i*2], t[i*2+1]);
		}
	}
	void update(int x, int v){
		x += MX; t[x] = pii(v, x-MX);
		while(x > 1){
			x /= 2;
			t[x] = min(t[x*2], t[x*2+1]);
		}
	}
	pii read(int s, int e){
		pii r = pii(1e9, -1);
		s += MX, e += MX;
		while(s <= e){
			if( s&1 ) r = min(r, t[s++]);
			if(~e&1 ) r = min(r, t[e--]);
			s /= 2, e /= 2;
		}
		return r;
	}
} tree;

vector<int> G[MX];
int A[MX], B[MX], C[MX], D[MX];
int N, K;

void make_dag(int s, int e, int v = -1){
	if( s > e ) return;
	pii t = tree.read(s, e);
	if( t.second == -1 ) return;
	if( v != -1 && v+K > t.first) G[t.first].push_back(v);
	make_dag(t.second+1, e, v);
}

int main()
{
	scanf("%d%d", &N, &K);
	for(int i = 1; i <= N; i++){
		scanf("%d", B+i);
		A[B[i]] = i;
	}
	tree.update(A);
	for(int i = 1; i <= N; i++){
		make_dag(1, B[i]-1, i);
		tree.update(B[i], 1e9);
	}
	int cnt[MX] = {};
	for(int i = 1; i <= N; i++){
		for(int c : G[i]){
			cnt[c]++;
		}
	}
	priority_queue<int, vector<int>, greater<int>> Q;
	vector<int> ans;
	for(int i = 1; i <= N; i++) if( cnt[i] == 0 ) Q.push(i);
	while(Q.size()){
		int p = Q.top(); Q.pop();
		ans.push_back(p);
		for(int c : G[p]){
			cnt[c]--;
			if( cnt[c] == 0 ) Q.push(c);
		}
	}
	for(int i = 0; i < ans.size(); i++) D[ans[i]] = i+1;
	for(int i = 1; i <= N; i++) printf("%d\n", D[i]);
}
