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 IO_OP std::ios::sync_with_stdio(0); std::cin.tie(0);
#define F first
#define S second
#define V vector
#define PB push_back
#define MP make_pair
#define EB emplace_back
#define ALL(v) (v).begin(), (v).end()
#define debug(x) cerr << #x << " is " << x << endl

using namespace std;

typedef long long ll;
typedef pair<int, int> pi;
typedef V<int> vi;

const int INF = 0x3f3f3f3f, N = 500005;

int p[N], nxt[N][2], in[N];
pi t[4*N];
int n, k;

void upd(int pos, pi val, int v = 1, int tl = 1, int tr = n) {
	if(tl == tr) {
		t[v] = val;
		return;
	}
	int tm = (tl + tr) / 2;
	if(pos <= tm) upd(pos, val, v*2, tl, tm);
	else 		  upd(pos, val, v*2+1, tm+1, tr);
	t[v] = min(t[v*2], t[v*2+1]); 
}

pi qry(int l, int r, int v = 1, int tl = 1, int tr = n) {
	if(l > r) return MP(INF, INF);
	if(l == tl && r == tr) return t[v];
	int tm = (tl + tr) / 2;
	return min(qry(l, min(r, tm), v*2, tl, tm),
			qry(max(l, tm+1), r, v*2+1, tm+1, tr));
}

signed main()
{
	IO_OP;
	memset(t, 0x3f, sizeof t);
	cin >> n >> k;
	for(int i=1;i<=n;i++) {
		int t;
		cin >> t;
		p[t] = i;
	}
	for(int i=n;i>=1;i--) {
		nxt[p[i]][0] = qry(max(1, p[i]), min(p[i]+k-1, n)).S;
		nxt[p[i]][1] = qry(max(1, p[i]-k+1), min(p[i], n)).S;
		upd(p[i], MP(i, p[i]));
		for(int j=0;j<2;j++)
			if(nxt[p[i]][j] != INF)
				in[nxt[p[i]][j]]++;
	}
	set<pi> s;
	for(int i=1;i<=n;i++)
		s.insert(MP(in[i], i));
	vi v;
	while(s.size()) {
		pi p = *s.begin(); s.erase(s.begin());
		v.PB(p.S);
		for(int i=0;i<2;i++)
			if(nxt[p.S][i] != INF) {
				int pp = nxt[p.S][i];
				s.erase(MP(in[pp], pp));
				in[pp]--;
				s.insert(MP(in[pp], pp));
			}		
	}
	for(int i=0;i<n;i++)
		p[v[i]] = i + 1;
	for(int i=1;i<=n;i++)
		cout << p[i] << endl;
	
}


