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<cstring>
#include<cstdlib>
#include<cstdio>
#include<cmath>
#include<iostream>
#include<queue>
#define N 510000
#define M 20500000
using namespace std;
struct node{int y,nex;}a[M];
struct node1{int lc,rc;}lt[M];
int n,m,p[N],tl,rt[N],ans[N],A[M],num,w[N],du[M],g[N];
int len,fir[M];
bool v[M],b[M];
priority_queue<int> q;
void ins(int x,int y)
{
	if(y==0) return;
	a[++len].y=y;a[len].nex=fir[x];fir[x]=len;
	du[y]++;
}
void link(int x,int l,int r,int fr,int ll,int rr)
{
	if(x==0) return;
	if(l==ll && r==rr) {ins(fr,x+n);return;}
	int mid=(ll+rr)/2;
	if(mid>=r) link(lt[x].lc,l,r,fr,ll,mid);
	else if(l>mid) link(lt[x].rc,l,r,fr,mid+1,rr);
	else link(lt[x].lc,l,mid,fr,ll,mid),link(lt[x].rc,mid+1,r,fr,mid+1,rr);
}
void change(int &x,int y,int k,int l,int r)
{
	x=++tl;lt[x]=lt[y];
	int mid=(l+r)/2;
	if(l==r) return;
	if(mid>=k) change(lt[x].lc,lt[y].lc,k,l,mid);
	else change(lt[x].rc,lt[y].rc,k,mid+1,r);
}
void dfs(int x)
{
	v[x]=1;
	for(int k=fir[x];k;k=a[k].nex)
	{
		int y=a[k].y;
		if(v[y]) continue;
		dfs(y);
	}
}
void dfs1(int x,int l,int r)
{
	if(x==0) return;
	b[x]=1;
	if(du[x+n])
	{
		if(l==r) 
			ins(x+n,l);
		else 
		{if(lt[x].lc) ins(x+n,lt[x].lc+n);
		if(lt[x].rc) ins(x+n,lt[x].rc+n);}
	}
	int mid=(l+r)/2;
	if(b[lt[x].lc]==0) dfs1(lt[x].lc,l,mid);
	if(b[lt[x].rc]==0) dfs1(lt[x].rc,mid+1,r);
}
void clear()
{
	for(int i=1;i<=num;i++)
	{
		int x=A[i];
		for(int k=fir[x];k;k=a[k].nex)
		{
			int y=a[k].y;
			du[y]--;
			if(du[y]==0)
			{
				if(y<=n) 
					q.push(y);
				else A[++num]=y;
			}
		}
	}
	num=0;
}
int main()
{
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++) {int x;scanf("%d",&x);p[x]=i;}
	for(int i=1;i<=n;i++)
	{
		link(rt[i-1],max(1,p[i]-m+1),min(n,p[i]+m-1),p[i],1,n);
		change(rt[i],rt[i-1],p[i],1,n);
	}
	for(int i=1;i<=n;i++) dfs1(rt[i],1,n);
	for(int i=1;i<=n;i++) 
		if(du[i]==0) q.push(i);
	for(int i=1;i<=n;i++)
	{
		int x=q.top();q.pop();
		ans[n-i+1]=x;
		A[++num]=x;
		clear();
	}
	for(int i=1;i<=n;i++) w[ans[i]]=i;
	for(int i=1;i<=n;i++) printf("%d\n",w[i]);
	return 0;
}