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>

#define all(v) (v).begin(), (v).end()
#define sortv(v) sort(all(v))
#define uniqv(v) (v).erase(unique(all(v)), (v).end())
#define pb push_back
#define FI first
#define SE second
#define lb lower_bound
#define ub upper_bound
#define mp make_pair
#define test 1
#define TEST if(test)

using namespace std;

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

const int MOD = 1000000007; // 998244353
const int INF = 2e9;
const ll INFLL = 1e18;
const int MAX_N = 500000;

int N, K;
int arr[MAX_N+1];
int idx[MAX_N+1];

int ans[MAX_N+1];
int mn[MAX_N+1];
vector<int> v;

void pro(int x, int y){
	if(x==y)	return;
	int m = (x+y)/2;
	pro(x, m); pro(m+1, y);
	int i1 = x, i2 = m+1;
	mn[m] = idx[m];
	for(int i=m-1; i>=x; i--){
		mn[i] = min(mn[i+1], idx[i]);
	}
	while(1){
		if(i1==m+1 && i2==y+1)	break;
		if(i1==m+1){
			v.pb(idx[i2]); i2++;
		}else if(i2==y+1){
			v.pb(idx[i1]); i1++;
		}else{
			if(mn[i1]>=idx[i2]+K){
				v.pb(idx[i2]); i2++;
			}else{
				v.pb(idx[i1]); i1++;
			}
		}
	}
	for(int i=0; i<v.size(); i++){
		idx[x+i] = v[i];
		//cout<<x+i<<" "<<v[i]<<endl;
	}//cout<<endl;
	while(!v.empty())	v.pop_back();
}

int main(){
	scanf("%d%d", &N, &K);
	for(int i=1; i<=N; i++){
		int x; scanf("%d", &x);
		arr[i] = x;
		idx[x] = i;
	}
	pro(1, N);
	for(int i=1; i<=N; i++){
		ans[idx[i]] = i;
	}
	for(int i=1; i<=N; i++){
		printf("%d\n", ans[i]);
	}
	return 0;
}
