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 <queue>
int N, K;
int a[500001], ref[500001], ans[500001];
int d[500001];
int T[1048576];
int head[500001], next[1000001], to[1000001], E;
int GL(int p, int l, int r, int x)
{
	if (!T[p])
		return 0;
	if (r <= x)
	{
		while (l < r)
		{
			int m = l + r >> 1;
			if (T[p << 1 | 1])
				p = p << 1 | 1, l = m + 1;
			else
				p <<= 1, r = m;
		}
		return l;
	}
	int m = l + r >> 1;
	int t = m + 1 <= x ? GL(p << 1 | 1, m + 1, r, x) : 0;
	return t ? t : GL(p << 1, l, m, x);
}
int GR(int p, int l, int r, int x)
{
	if (!T[p])
		return 0;
	if (l >= x)
	{
		while (l < r)
		{
			int m = l + r >> 1;
			if (T[p << 1])
				p <<= 1, r = m;
			else
				p = p << 1 | 1, l = m + 1;
		}
		return l;
	}
	int m = l + r >> 1;
	int t = m >= x ? GR(p << 1, l, m, x) : 0;
	return t ? t : GR(p << 1 | 1, m + 1, r, x);
}
void P(int x, int w)
{
	int p = 1, l = 1, r = N;
	T[p] += w;
	while (l < r)
	{
		int m = l + r >> 1;
		if (x <= m)
			p <<= 1, r = m;
		else
			p = p << 1 | 1, l = m + 1;
		T[p] += w;
	}
}
void add(int u, int v)
{
	d[u]++;
	next[++E] = head[v];
	to[E] = u;
	head[v] = E;
}
std::priority_queue < int > Q;
int main()
{
	scanf("%d%d", &N, &K);
	for (int i = 1; i <= N; i++)
		scanf("%d", a + i);
	for (int i = 1; i <= N; i++)
	{
		int L = GL(1, 1, N, a[i]), R = GR(1, 1, N, a[i]);
		if (L)
			add(ref[L], i);
		if (R)
			add(i, ref[R]);
		ref[a[i]] = i;
		P(a[i], 1);
		if (i >= K)
			P(a[i - K + 1], -1);
	}
	for (int i = 1; i <= N; i++)
		if (d[i] == 0)
			Q.push(i);
	for (int w = N; w; w--)
	{
		int pos = Q.top();
		Q.pop();
		ans[pos] = w;
		for (int e = head[pos]; e; e = next[e])
			if (!--d[to[e]])
				Q.push(to[e]);
	}
	for (int i = 1; i <= N; i++)
		printf("%d\n", ans[i]);
	return 0;
}
