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<iostream>
#include<vector>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<queue>
#include<set>
using namespace std;
const int N=2e6;
int gi() {
	int w=0;bool q=1;char c=getchar();
	while ((c<'0'||c>'9') && c!='-') c=getchar();
	if (c=='-') q=0,c=getchar();
	while (c>='0'&&c <= '9') w=w*10+c-'0',c=getchar();
	return q? w:-w;
}
int p[N];
int head[N],next[N],to[N],d[N],tot,ans[N];
struct cmp{ inline bool operator () (const int &a,const int &b) const { return p[a]<p[b]; } };
struct cmp2{ inline bool operator () (const int &a,const int &b) const { return a>b; } };
inline void link(int a,int b) { d[to[++tot]=b]++,next[tot]=head[a],head[a]=tot; }
int main()
{
	int n=gi(),m=gi(),i,k,t;
	for (i=1;i<=n;i++) p[i]=gi();
	set<int,cmp>s;set<int>::iterator it;
	priority_queue<int,vector<int>,cmp2>q;
	for (i=1;i<=n;i++) {
		if (i>m) s.erase(i-m);
		it=s.insert(i).first;
		if (++it!=s.end()) link(i,*it);
	}
	s.clear();
	for (i=n;i;i--) {
		if (i+m<=n) s.erase(i+m);
		it=s.insert(i).first;
		if (++it!=s.end()) link(i,*it);
	}
	for (i=1;i<=n;i++) if (!d[i]) q.push(i);
	for (t=1;t<=n;t++) {
		k=q.top();q.pop();
		ans[k]=t;
		for (i=head[k];i;i=next[i]) if (!--d[to[i]]) q.push(to[i]);
	}
	for (i=1;i<=n;i++) printf("%d\n",ans[i]);
	return 0;
}
