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
//IOI 2021
#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define ff first
#define ss second

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

const int MAXN = 5 * 100 * 1000 + 17;

int n, k, a[MAXN], seg[MAXN << 2], p[MAXN];
set<int> s;

void upd(int pos, int v = 1, int l = 1, int r = n + 1) {
	if (pos < l || r <= pos) return;
	if (l + 1 == r) {
		seg[v] = pos;
		return;
	}
	upd(pos, v << 1, l, l + r >> 1);
	upd(pos, v << 1 | 1, l + r >> 1, r);
	if (a[seg[v << 1]] > a[seg[v << 1 | 1]]) seg[v] = seg[v << 1];
	else seg[v] = seg[v << 1 | 1];
}
int get(int lp, int rp, int v = 1, int l = 1, int r = n + 1) {
	if (rp <= l || r <= lp) return 0;
	if (lp <= l && r <= rp) return seg[v];
	int lg = get(lp, rp, v << 1, l, l + r >> 1), rg = get(lp, rp, v << 1 | 1, l + r >> 1, r);
	if (a[lg] > a[rg]) return lg;
	else return rg;
}
int getST(int x) { return x * (k - 1) + 1; }
int getEN(int x) { return min((x + 1) * (k - 1) + 1, n + 1); }
void addMAX(int x) {
	int pos = get(getST(x), getEN(x));
	if (get(pos - k + 1, pos + k) == pos && a[pos] > 0)
		s.insert(pos);
}
int main() {
	ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	cin >> n >> k;
	for (int i = 1; i <= n; i++)
		cin >> a[i], upd(i);
	if (k == 1) {
		for (int i = 1; i <= n; i++)
			cout << i << '\n';
		return 0;
	}
	for (int i = 0; i < (n + k - 2) / (k - 1); i++) addMAX(i);
	int label = n;
	while (s.size()) {
		int u = *s.rbegin();
		s.erase(u);
		a[u] = -1;
		upd(u);
		p[u] = label--;
		int bl = (u - 1) / (k - 1);
		addMAX(bl);
		if (bl == 0) addMAX(bl + 1);
		else if (bl + 1 == (n + k - 2) / (k - 1)) addMAX(bl - 1);
		else addMAX(bl - 1), addMAX(bl + 1);
	}
	for (int i = 1; i <= n; i++)
		cout << p[i] << '\n';
	return 0;
}
