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<stdio.h>
#include<vector>
#include<algorithm>
#include<set>
using namespace std;
#define SIZE 524288
class segtree
{
public:
	int seg[SIZE * 2];
	void init()
	{
		fill(seg, seg + SIZE * 2, -1);
	}
	void update(int a, int b)
	{
		a += SIZE;
		seg[a] = max(seg[a], b);
		for (;;)
		{
			a /= 2;
			if (a == 0)break;
			seg[a] = max(seg[a * 2], seg[a * 2 + 1]);
		}
	}
	int get(int beg, int end, int node, int lb, int ub)
	{
		if (ub < beg || end < lb)return -1;
		if (beg <= lb&&ub <= end)return seg[node];
		return max(get(beg, end, node * 2, lb, (lb + ub) / 2), get(beg, end, node * 2 + 1, (lb + ub) / 2 + 1, ub));
	}
};
segtree tree;
int d[505050];
vector<int>pat[505050];
int ans[505050];
int pt = 0;
void dfs(int node)
{
	sort(pat[node].begin(), pat[node].end());
	for (int i = 0; i < pat[node].size(); i++)dfs(pat[node][i]);
	ans[node] = pt++;
}
int main()
{
	int num, gen;
	scanf("%d%d", &num, &gen);
	gen--;
	for (int i = 0; i < num; i++)
	{
		int z;
		scanf("%d", &z);
		z--;
		d[z] = i;
	}
	tree.init();
	for (int i = num - 1; i >= 0; i--)
	{
		int r = tree.get(d[i] - gen, d[i], 1, 0, SIZE - 1);
		if (r != -1)pat[d[num - 1 - r]].push_back(d[i]);
		else pat[num].push_back(d[i]);
		tree.update(d[i], num - 1 - i);
	}
	dfs(num);
	for (int i = 0; i < num; i++)printf("%d\n", ans[i] + 1);
}