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;

const int MN = 501234, INF = 1012345678;
int se[MN * 4], seg[MN * 4], lz[MN * 4], n, a[MN], g[MN], b[MN];

void boom(int v) {
	seg[v * 2] += lz[v];
	seg[v * 2 + 1] += lz[v];
	lz[v * 2] += lz[v];
	lz[v * 2 + 1] += lz[v];
	lz[v] = 0;
}
void add(int l, int r, int val, int s = 0, int e = n, int v = 1) {
	if (r <= s || e <= l)
		return;
	if (l <= s && e <= r) {
		seg[v] += val;
		lz[v] += val;
		return;
	}
	boom(v);
	int mid = (s + e) / 2;
	add(l, r, val, s, mid, v * 2);
	add(l, r, val, mid, e, v * 2 + 1);
	seg[v] = min(seg[v * 2], seg[v * 2 + 1]);
}
int get_min(int s = 0, int e = n, int v = 1) {
	if (e - s == 1)
		return s;
	boom(v);
	int mid = (s + e) / 2;
	if (seg[v * 2 + 1] == 0)
		return get_min(mid, e, v * 2 + 1);
	else
		return get_min(s, mid, v * 2 );
}
void add(int p) {
	for (p++; p < MN; p += p & -p)
		se[p]++;
}
int get(int p) {
	int sum = 0;
	for (; p > 0; p -= p & -p)
		sum += se[p];
	return sum;
}
int get(int l, int r) {
	return get(r) - get(l);
}

int main() {
	int k;
	cin >> n >> k;
	for (int i = 0; i < n; i++)
		cin >> g[i];
	for (int i = 0; i < n; i++)
		a[g[i] - 1] = i;
	for (int i = n - 1; i >= 0; i--) {
//		int x;
//     	cerr << max(0, a[i] - k + 1) << ' ' << min(n, a[i] + k) << endl;
		add(a[i], a[i] + 1, get(max(0, a[i] - k + 1), min(n, a[i] + k)));
//		cerr << x << endl;
//     	for (int i = 0; i < n; i++)
//         cerr << get(i, i + 1) << ' ';
//     	cerr << endl;
     	add(a[i]);
	}
//	cerr << endl;
	for (int i = 0; i < n; i++) {
		int v = get_min();
//		cerr << v << endl;
		add(v, v + 1, INF);
		add(max(v - k + 1, 0), min(v + k, n), -1);
		b[v] = n - i;
	}
	for (int i = 0; i < n; i++)
		cout << b[i] << ' ';
}