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;
typedef long long ll;
inline ll read(){
    ll x = 0,f = 1;char ch = getchar();
    while(ch < '0' || ch > '9'){if(ch == '-') f = -1;ch = getchar();}
    while(ch >= '0' && ch <= '9'){x = x*10+ch-'0';ch = getchar();}
    return x*f;
}

const int N = 500005;
int n,k;
int a[N],b[N];
int Mi[N<<2];
int head[N],nxt[N*2],to[N*2],cnt;
int ru[N],m;

inline void insert(int x,int y){
	to[++cnt] = y; nxt[cnt] = head[x]; head[x] = cnt;
}

int query(int num,int l,int r,int x,int y){
	if(x <= l && r <= y) return Mi[num];
	int mid = (l+r)>>1,ans = 1e9;
	if(x <= mid) ans = query(num<<1,l,mid,x,y);
	if(y > mid) ans = min(ans,query(num<<1|1,mid+1,r,x,y));
	return ans;
}

void change(int num,int l,int r,int x,int y){
	Mi[num] = min(Mi[num],y);
	if(l == r) return;
	int mid = (l+r)>>1;
	if(x <= mid) change(num<<1,l,mid,x,y);
	else change(num<<1|1,mid+1,r,x,y);
}

void toposort(){
	priority_queue<int,vector<int>,greater<int> > Q;
	for(int i = 1;i <= n;++i)
		if(ru[i] == 0) Q.push(i);
	while(!Q.empty()){
		int x = Q.top(); Q.pop();
		b[x] = ++m;
		for(int i = head[x];i;i = nxt[i]){
			--ru[to[i]];
			if(ru[to[i]] == 0) Q.push(to[i]);
		}
	}
}

signed main(){
	n = read(); k = read();
	for(int i = 1;i <= n;++i){ int x = read(); a[x] = i; }
	memset(Mi,0x3f,sizeof Mi);
	for(int i = n;i >= 1;--i){
		int x;
		if(a[i] < n){
			x = query(1,1,n,a[i]+1,min(a[i]+k-1,n));
			if(x >= 1 && x <= n) insert(a[i],a[x]),++ru[a[x]];
		}
		if(a[i] > 1){
			x = query(1,1,n,max(a[i]-k+1,1),a[i]-1);
			if(x >= 1 && x <= n) insert(a[i],a[x]),++ru[a[x]];
		}
		change(1,1,n,a[i],i);
	}
	toposort();
	for(int i = 1;i <= n;++i) printf("%d\n",b[i]);
	return 0;
}