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<set>
#include<queue>
#include<vector>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define N 500500
#define ri register int
using namespace std;

int n,k;
int a[N],p[N],ans[N],ans2[N],ru[N];

set<int> s;
vector<int> to[N];
priority_queue<int> pq;

void add_edge(int u,int v) {
  to[v].push_back(u); ru[u]++;
}

inline int read() {
  int ret=0,f=0; char ch=getchar();
	while (ch<'0' || ch>'9') f|=(ch=='-'),ch=getchar();
	while (ch>='0' && ch<='9') ret*=10,ret+=(ch-'0'),ch=getchar();
	return f?-ret:ret;
}

int main() {
  n=read(); k=read();
	for (ri i=1;i<=n;i++) a[p[i]=read()]=i;
  
	for (ri i=1;i<=n+k-1;i++) {
	  if (i<=n) s.insert(p[i]);
		if (i-k+1>=1) s.erase(p[i-k+1]);
		if (i+1<=n) {
			set<int> ::  iterator cur=s.upper_bound(p[i+1]);
			if (cur!=s.end()) add_edge(i+1,a[*cur]);
		}
		if (i-k+1>=1) {
		  set<int> :: iterator cur=s.upper_bound(p[i-k+1]);
			if (cur!=s.end()) add_edge(i-k+1,a[*cur]);
		}
	}
	
	for (ri i=1;i<=n;i++) if (!ru[i]) pq.push(i);
	int cc=0;
	while (!pq.empty()) {
	  int x=pq.top(); pq.pop();
		ans[++cc]=x;
		for (ri i=0;i<to[x].size();i++) {
		  int y=to[x][i];
			ru[y]--;
			if (!ru[y]) pq.push(y);
		}
	}
	
	for (ri i=1;i<=n;i++) ans2[ans[n-i+1]]=i;
	for (ri i=1;i<=n;i++) printf("%d\n",ans2[i]);
	return 0;
}