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 <cstdio>
#include <vector>
#include <algorithm>

using namespace std;

const int MaxN = 501234;

int n, K, P[MaxN];
int seg[MaxN << 2]; vector<int> af[MaxN];

void modify(int p, int l, int r, int x, int v) {
	if(l == r) {
		seg[p] = v;
	} else {
		if(x <= (l + r >> 1))
			modify(p << 1, l, l + r >> 1, x, v);
		else
			modify(p << 1 | 1, (l + r >> 1) + 1, r, x, v);
		seg[p] =max(seg[p << 1], seg[p << 1 | 1]);
	}
}

int query(int p, int l, int r, int a, int b) {
	if(r < l) return 0;
	if(r < a || l > b) return 0;
	if(a <= l && r <= b) return seg[p];
	return max(query(p << 1, l, l + r >> 1, a, b), query(p << 1 | 1, (l + r >> 1) + 1, r, a, b));
}

int pos[MaxN], ans[MaxN], an = -1;

void getans(int x) {
	ans[++an] = x;
	sort(af[x].begin(), af[x].end());
	for(int i = 0; i < af[x].size(); i++)
		getans(af[x][i]); 
}

int main() {
	int i; scanf("%d %d", &n, &K);
	for(i = 1; i <= n; i++) scanf("%d", P + i);
	for(i = 1; i <= n; i++) pos[P[i]] = i; pos[n + 1] = n + 1;
	for(i = 1; i <= n; i++) {
		int prev = query(1, 1, n, pos[i] + 1, min(pos[i] + K - 1, n));
		if(!prev) prev = n + 1;
		af[pos[prev]].push_back(pos[i]);
		modify(1, 1, n, pos[i], i); 
	}
	getans(n + 1);	
	for(i = 1; i <= n; i++) P[ans[i]] = i;
	for(i = 1; i <= n; i++) printf("%d\n", P[i]);
	return 0;
}