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<bits/stdc++.h>
using namespace std;
const int N=500010;
int gi()
{
	int f=0; char ch=getchar();
	while(ch<'0' || ch>'9')ch=getchar();
	while(ch>='0' && ch<='9')f=f*10+ch-48,ch=getchar();
	return f;
}
int n,k,p[N],a[N];
struct node
{
	int mn;
}s[N<<2];
void pushup(int k)
{
	s[k].mn=min(s[k<<1].mn,s[k<<1|1].mn);
}
void build(int l,int r,int k)
{
	if(l==r)
	{
		s[k].mn=n+1;
		return; 
	}
	int mid=l+r>>1;
	build(l,mid,k<<1); build(mid+1,r,k<<1|1);
	s[k].mn=n+1;
}
int head[N],cnt,ct;
struct edge
{
	int fr,to,next;
	bool operator < (const edge a)const
	{
		return to<a.to;
	}
}e[N<<1];
void adde(int k)
{
	e[k].next=head[e[k].fr]; head[e[k].fr]=k;
}
int query(int L,int R,int l,int r,int k)
{
	if(l>r)return n+1;
	if(l<=L && R<=r)
		return s[k].mn;
	int mid=L+R>>1,res=n+1;
	if(l<=mid)
		res=min(res,query(L,mid,l,r,k<<1));
	if(r>mid)
		res=min(res,query(mid+1,R,l,r,k<<1|1));
	return res;
}
void modify(int l,int r,int p,int x,int k)
{
	if(l==r)
	{
		s[k].mn=x;
		return;
	}
	int mid=l+r>>1;
	if(p<=mid)
		modify(l,mid,p,x,k<<1);
	else
		modify(mid+1,r,p,x,k<<1|1);
	pushup(k);
}
int in[N];
priority_queue<int,vector<int>,greater<int> >q;
int id[N];
void topsort()
{
	for(int i=1;i<=n;i++)
		for(int j=head[i];j;j=e[j].next)
		{
			int v=e[j].to;
			in[v]++;
		}
	for(int i=1;i<=n;i++)
		if(!in[i])
			q.push(i);
	while(!q.empty())
	{
		int k=q.top(); q.pop();
		printf("%d\n",k);
		for(int i=head[k];i;i=e[i].next)
		{
			int v=e[i].to;
			in[v]--;
			if(!in[v])q.push(v);
		}
	}
}
int main()
{
	n=gi(); k=gi();
	for(int i=1;i<=n;i++)
		p[i]=gi(),a[p[i]]=i;
	build(1,n,1);
	for(int i=n;i;i--)
	{
		int x=query(1,n,max(a[i]-k+1,1),a[i]-1,1);
		if(x<=n)
			e[++cnt].fr=a[i],e[cnt].to=a[x];
		x=query(1,n,a[i]+1,min(a[i]+k-1,n),1);
		if(x<=n)
			e[++cnt].fr=a[i],e[cnt].to=a[x];
		modify(1,n,a[i],i,1);
	}
	sort(e+1,e+cnt+1);
	for(int i=1;i<=cnt;i++)
		adde(i);
	topsort();
	return 0;
}
