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 SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define RI(X) scanf("%d", &(X))
#define RII(X, Y) scanf("%d%d", &(X), &(Y))
#define RIII(X, Y, Z) scanf("%d%d%d", &(X), &(Y), &(Z))
#define DRI(X) int (X); scanf("%d", &X)
#define DRII(X, Y) int X, Y; scanf("%d%d", &X, &Y)
#define DRIII(X, Y, Z) int X, Y, Z; scanf("%d%d%d", &X, &Y, &Z)
#define RS(X) scanf("%s", (X))
#define CASET int ___T, case_n = 1; scanf("%d ", &___T); while (___T-- > 0)
#define MP make_pair
#define PB push_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define PII pair<int,int>
#define VI vector<int>
#define VPII vector<pair<int,int> >
#define PLL pair<long long,long long>
#define VPLL vector<pair<long long,long long> >
#define F first
#define S second
typedef long long LL;
using namespace std;
const int MOD = 1e9+7;
const int SIZE = 1e6+10;
int a[SIZE],p[SIZE],d[SIZE],an[SIZE];
set<int>D,U,H;
VI e[SIZE];
int main()
{
	DRII(N,K);
	REPP(i,1,N+1)
	{
		RI(a[i]);
		p[a[i]]=i;
	}
	int rr=1;
	D.insert(N+1);
	D.insert(0);
	REPP(i,1,N+1)
	{
		if(i-K>0) D.erase(a[i-K]);
		set<int>::iterator it;
		it=D.lower_bound(a[i]);
		if(*it!=N+1)d[i]++,e[p[*it]].PB(i);
		it--;
		if(*it!=0)d[p[*it]]++,e[i].PB(p[*it]);
		D.insert(a[i]);
	}

	REPP(i,1,N+1)  if(d[i]==0)H.insert(i);
	REP(kk,N)
	{
		int x=*H.rbegin();
		H.erase(x);
		an[x]=N-kk;
		REP(i,SZ(e[x]))
		{
			d[e[x][i]]--;
			if(!d[e[x][i]])  H.insert(e[x][i]);
		}
	}

	for(int i=1; i<=N; i++)printf("%d%c",an[i],i<N?' ':'\n');

	return 0;
}
