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 ls now<<1
#define rs now<<1|1
#define res register int
using namespace std;
inline int read()
{
  char ch;
  for(ch=getchar(); ch<'0'||ch>'9'; ch=getchar());
  int x=ch-'0';
  for(ch=getchar(); ch>='0'&&ch<='9'; ch=getchar()) x=x*10+ch-'0';
  return x;
}
inline void write(int x)
{
  if (!x)
  {
    puts("0");
    return;
  }
  char ch[20];
  int tot=0;
  for(; x; x/=10) ch[++tot]=x%10+'0';
  for(res i=tot; i>=1; i--) putchar(ch[i]);
  puts("");
}
const int N=50000+5;
set<int> s;
int n,k,site[N],q[N],deg[N],tr[N<<2];
int d[N],Next[N*2],to[N*2],tot;
struct Segmentree
{
  inline void pushup(res now)
  {
    tr[now]=min(tr[ls],tr[rs]);
  }
  inline void build(res now,res tot,res r)
  {
    tr[now]=n+1;
    if (tot==r) return;
    res mid=tot+r>>1;
    build(ls,tot,mid);
    build(rs,mid+1,r);
  }
  inline void update(res now,res tot,res r,res x,res y)
  {
    if (tot==r)
    {
      tr[now]=y;
      return;
    }
    int mid=tot+r>>1;
    if (x<=mid) update(ls,tot,mid,x,y);
    else update(rs,mid+1,r,x,y);
    pushup(now);
  }
  inline int find(int now,int tot,int r,int x,int y)
  {
    if (tot==x&&r==y) return tr[now];
    int m=tot+r>>1;
    if (y<=m) return find(ls,tot,m,x,y);
    else if (x>m) return find(ls|1,m+1,r,x,y);
    else
    {
      int a=find(ls,tot,m,x,m),b=find(rs,m+1,r,m+1,y);
      return (a<b)?a:b;
    }
  }
} T;
inline void add(int x,int y)
{
  to[++tot]=y;
  deg[y]++;
  Next[tot]=d[x];
  d[x]=tot;
}
int main()
{
  n=read();
  k=read();
  for(res i=1; i<=n; i++) site[i]=read(),q[site[i]]=i;
  T.build(1,1,n);
  for(res i=n; i>=1; i--)
  {
    int x;
    x=T.find(1,1,n,max(q[i]-k+1,1),q[i]);
    if (x<=n) add(q[i],q[x]);
    x=T.find(1,1,n,q[i],min(q[i]+k-1,n));
    if (x<=n) add(q[i],q[x]);
    T.update(1,1,n,q[i],i);
  }
  for(res i=1; i<=n; i++)
    if (!deg[i])
      s.insert(i);
  for(res i=1; i<=n; i++)
  {
    int x=q[i]=*s.begin();
    s.erase(s.begin());
    for(res i=d[x]; i; i=Next[i]) if (!(--deg[to[i]])) s.insert(to[i]);
  }
  for(res i=1; i<=n; i++) site[q[i]]=i;
  for(res i=1; i<=n; i++) write(site[i]);
  return 0;
}