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<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<algorithm>
#include<vector>
#include<queue>
using namespace std;
#define REP(i,st,ed) for(int i=st,i##end=ed;i<=i##end;++i)
#define DREP(i,st,ed) for(int i=st,i##end=ed;i>=i##end;--i)
const int maxn=500005,inf=0x3f3f3f3f;
struct seg_tree{
	int Max[maxn<<2];
	void push_up(int p,int u,int v){
		Max[p]=max(Max[u],Max[v]);
	}
	int query(int p,int l,int r,int L,int R){
		if((L<=l)&&(R>=r))return Max[p];
		int mid=(l+r)>>1,u=p<<1,v=u+1,res=0;
		if(L<=mid)res=query(u,l,mid,L,R);
		if(R>mid)res=max(res,query(v,mid+1,r,L,R));
		return res;
	}
	void update(int p,int l,int r,int pos,int val){
		if(l==r){
			Max[p]=val;
			return;
		}
		int mid=(l+r)>>1,u=p<<1,v=u+1;
		if(pos<=mid)update(u,l,mid,pos,val);
		else update(v,mid+1,r,pos,val);
		push_up(p,u,v);
	}
}T;
int n,m,a[maxn],p[maxn],s[maxn],tot;
vector<int>E[maxn];
priority_queue<int,vector<int>,greater<int> >Q;
void dfs(int u){
	REP(i,0,E[u].size()-1)Q.push(E[u][i]);
	while(!Q.empty()){
		int v=Q.top();
		s[++tot]=v;
		Q.pop(),dfs(v);
	}
}
int main(){
	scanf("%d%d",&n,&m);
	REP(i,1,n)
		scanf("%d",&a[i]),p[a[i]]=i;
	if(m==1){
		REP(i,1,n)
			printf("%d\n",i);
		return 0;
	}
	REP(i,1,n){
		E[p[T.query(1,1,n,p[i]+1,p[i]+m-1)]].push_back(p[i]);
		T.update(1,1,n,p[i],i);
	}
	dfs(0);
	REP(i,1,n)
		a[s[i]]=i;
	REP(i,1,n)
		printf("%d\n",a[i]);
	return 0;
}