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>
using namespace std ;
#define Next( i, x ) for( register int i = head[x]; i; i = e[i].next )
#define rep( i, s, t ) for( register int i = (s); i <= (t); ++ i )
#define drep( i, s, t ) for( register int i = (t); i >= (s); -- i )
#define re register
#define ls(x) tr[x].l
#define rs(x) tr[x].r
int gi() {
	char cc = getchar() ; int cn = 0, flus = 1 ;
	while( cc < '0' || cc > '9' ) {  if( cc == '-' ) flus = - flus ; cc = getchar() ; }
	while( cc >= '0' && cc <= '9' )  cn = cn * 10 + cc - '0', cc = getchar() ;
	return cn * flus ;
}
const int N = 5e5 + 5 ; 
const int M = 2e7 + 5 ; 
int n, K, root, cnt, num, deg[M], P[N], a[N], head[M] ; 
struct Tr { 
	int l, r ; 
} tr[M] ; 
struct E { int to, next ; } e[M] ;
void add( int x, int y ) {
	e[++ num] = (E){ y, head[x] }, head[x] = num, ++ deg[y] ; 
}
void insert( int &x, int u, int l, int r, int wh, int id ) {
	x = ++ cnt, tr[x] = tr[u] ; 
	if( l == r ) { add( x, id ) ; return ; }
	int mid = ( l + r ) >> 1 ; 
	if( mid >= wh ) insert( ls(x), ls(u), l, mid, wh, id ) ;
	else insert( rs(x), rs(u), mid + 1, r, wh, id ) ;
	add( x, ls(x) ), add( x, rs(x) ) ;
}
void build( int &x, int l, int r ) {
	x = ++ cnt ; if( l == r ) return ; 
	int mid = ( l + r ) >> 1 ; 
	build( ls(x), l, mid ), build( rs(x), mid + 1, r ) ;
	add( x, ls(x) ), add( x, rs(x) ) ;
}
void Add( int x, int l, int r, int ql, int qr, int id ) {
	if( l > qr || r < ql ) return ; 
	if( ql <= l && r <= qr ) { add( id, x ) ; return ; }
	int mid = ( l + r ) >> 1 ; 
	Add( ls(x), l, mid, ql, qr, id ), Add( rs(x), mid + 1, r, ql, qr, id ) ;
}
priority_queue<int> q ; 
int Ans[N], Q[N] ; 
signed main()
{
	n = gi(), K = gi(), cnt = n ; 
	rep( i, 1, n ) P[i] = gi(), a[P[i]] = i ; 
	build( root, 1, n ) ;
	rep( i, 1, n ) {
		if( i ^ 1 ) Add( root, 1, n, max( 1, a[i] - K + 1 ), min( n, a[i] + K - 1 ), a[i] ) ;
		int bef = root ; 
		insert( root, bef, 1, n, a[i], a[i] ) ;
	} 
	rep( i, 1, cnt ) if( !deg[i] ) q.push(i) ; 
	int top = n ; 
	while( !q.empty() ) {
		int u = q.top() ; q.pop() ; 
		Next( i, u ) {
			int v = e[i].to ; -- deg[v] ; if( !deg[v] ) q.push(v) ; 
		}
		if( u <= n ) Ans[top] = u, -- top ; 
	}
	rep( i, 1, n ) Q[Ans[i]] = i ;
	rep( i, 1, n ) printf("%d\n", Q[i] ) ;
	return 0 ;
}