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;
const int N=1e6+7,M=1e9;
 
#define C getchar()-48
int read()
{
  int s=0,t=1,k=C;
  for (;k<0||9<k;k=C) if (k==-3) t=-1;
  for (;0<=k&&k<=9;k=C) s=(s<<1)+(s<<3)+k;
  return s*t;
}
 
  int n,k;
  int a[N];
void in()
{
  cin>>n>>k;
  for (int i=0;++i<=n;)
    a[read()]=i;
}
 
  struct tr
    {
      int l,r,m;
    }tr[N+N];
#define ls(k) k*2
#define rs(k) k*2+1
void bui(int k,int l,int r)
{
  tr[k].l=l;tr[k].r=r;
  tr[k].m=M;
  if (l==r) return;
  int m=l+r>>1;
  bui(ls(k),l,m);
	bui(rs(k),m+1,r);
}
 
void add(int k,int p,int v)
{
  tr[k].m=v;
  if (tr[k].l==tr[k].r)
    return;
  if (tr[ls(k)].r<p)
    add(rs(k),p,v);
  else
    add(ls(k),p,v);
}
 
int que(int k,int l,int r)
{
  if (tr[k].r<l||r<tr[k].l)
    return M;
  if (l<=tr[k].l&&tr[k].r<=r)
    return tr[k].m;
  int x=que(ls(k),l,r),
      y=que(rs(k),l,r);
  return min(x,y);
}
 
  int t;
  int h[N],d[N];
  struct hh
    {
      int n,r;
    }e[N];
void ins(int x,int y)
{
  e[++t]=(hh){h[x],y};
	h[x]=t;++d[y];
}
 
  set<int> S;
  int A[N];
#define P(i) e[i].r
void top()
{
  for (int i=0;++i<=n;)    
    if (!d[i]) S.insert(i);
  for (int j=0;++j<=n;)
    {
      int x=*S.begin();
      A[x]=j;
      S.erase(x);
      for (int i=h[x];i;i=e[i].n)
        if (--d[P(i)]==0)
          S.insert(P(i));
    }
}
 
void wor()
{
  bui(1,1,n);
  for (int i=n,x;i;--i)
    {
      x=que(1,a[i]-k+1,a[i]);
      if (x<=n) ins(a[i],a[x]);
      x=que(1,a[i],a[i]+k-1);
      if (x<=n) ins(a[i],a[x]);
      add(1,a[i],i);
    }  
  top();
}
 
void out()
{
  for (int i=0;++i<=n;)
    printf("%d\n",A[i]);
}
 
int main()
{
  in();
  wor();
  out();
  exit(0);
}