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
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int u, v; ll w; };

int INF = INT_MAX / 2;
ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;

struct unko {
	int l, r; i_i mi;
	unko *lch, *rch;
	unko(int l, int r) : l(l), r(r) {
		if (r - l == 1) return;
		lch = new unko(l, (l + r) / 2);
		rch = new unko((l + r) / 2, r);
	}
	i_i get(int i, int j) {
		if (j <= l || r <= i) return i_i(INF, -1);
		if (i <= l && r <= j) return mi;
		return min(lch->get(i, j), rch->get(i, j));
	}
	void set(int i, int x) {
		if (i < l || r <= i) return;
		if (r - l == 1) {
			mi = i_i(x, i);
			return;
		}
		lch->set(i, x);
		rch->set(i, x);
		mi = min(lch->mi, rch->mi);
	}
};

int N, K, i = 0;
unko* z;
int ans[500001];

void f(int r, int x) {
	for (;;) {
		i_i p = z->get(0, r);
		if (p.first - x >= K) break;
		f(p.second, p.first);
	}
	z->set(r, INF);
	ans[x] = i++;
}

int main() {
	cin >> N >> K;
	z = new unko(0, N);
	for (int i = 0; i < N; i++) {
		int p; scanf("%d", &p); p--;
		z->set(p, i);
	}
	f(N, N);
	for (int i = 0; i < N; i++)
		printf("%d\n", ans[i] + 1);
}
