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
// High above the clouds there is a rainbow...

#include<bits/stdc++.h>

#define F first
#define S second
#define PB push_back
#define sz(s) int((s).size())
#define bit(n,k) (((n)>>(k))&1)

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

const int maxn=5e5+10,inf=1e9;

int n,pos[maxn];
vector<int>v[maxn];

int val[2*maxn];

void add(int pos,int x){
    pos+=n;
    val[pos]=x;
    for(pos>>=1; pos>0 ; pos>>=1)
	val[pos]= min(val[2*pos], val[2*pos+1]);
}
int ask(int f,int s){
    int ans=inf;
    for(f+=n,s+=n; f<s; f>>=1, s>>=1){
	if(f&1) ans=min(ans,val[f++]);
	if(s&1) ans=min(ans,val[--s]);
    }
    return ans;
}

priority_queue<int,vector<int>,greater<int> >pq;
int SZ[maxn];

void adde(int a,int b){
    v[a].PB(b);
    SZ[b]++;
}

int ANS[maxn];

int main(){
    ios_base::sync_with_stdio(false);cin.tie(0);
    
    int k;cin>>n>>k;
    for(int i=0;i<n;i++){
	int x;cin>>x;
	pos[--x]=i;
    }

    fill(val,val+2*maxn,inf);
    
    for(int i=n-1;i>=0;i--){
	int num=ask(pos[i],min(pos[i]+k,n));
	if(num!=inf) adde(pos[i],pos[num]);
	num=ask( max(int(0),pos[i]-k+1), pos[i] );
	if(num!=inf) adde(pos[i],pos[num]);
	add(pos[i],i);
    }
    
    for(int i=0;i<n;i++){
	if(SZ[i]==0) pq.push(i);
    }

    int C=0;
    
    while(sz(pq)){
	int u=pq.top();
	pq.pop();
	ANS[u]=C++;
	for(int y:v[u]){
	    if(--SZ[y]==0)
		pq.push(y);
	}
    }
    for(int i=0;i<n;i++){
	cout<<ANS[i]+1<<"\n";
    }
    return 0;
}
// Deathly mistakes:
//  * Read the problem curfully.
//  * Check maxn.
//  * Overflows.