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;
template <typename TH>
void _dbg(const char* sdbg, TH h) {
  cerr << sdbg << "=" << h << "\n";
}
template <typename TH, typename... TA>
void _dbg(const char* sdbg, TH h, TA... t) {
  while (*sdbg != ',') cerr << *sdbg++;
  cerr << "=" << h << ",";
  _dbg(sdbg + 1, t...);
}
template <class C>
void mini(C& a4, C b4) {
  a4 = min(a4, b4);
}
template <class C>
void maxi(C& a4, C b4) {
  a4 = max(a4, b4);
}
template <class T1, class T2>
ostream& operator<<(ostream& out, pair<T1, T2> pair) {
  return out << "(" << pair.first << ", " << pair.second << ")";
}
template <class A, class B, class C>
struct Triple {
  A first;
  B second;
  C third;
  bool operator<(const Triple& t) const {
    if (first != t.first) return first < t.first;
    if (second != t.second) return second < t.second;
    return third < t.third;
  }
};
template <class T>
void ResizeVec(T&, vector<int>) {}
template <class T>
void ResizeVec(vector<T>& vec, vector<int> sz) {
  vec.resize(sz[0]);
  sz.erase(sz.begin());
  if (sz.empty()) {
    return;
  }
  for (T& v : vec) {
    ResizeVec(v, sz);
  }
}
template <class A, class B, class C>
ostream& operator<<(ostream& out, Triple<A, B, C> t) {
  return out << "(" << t.first << ", " << t.second << ", " << t.third << ")";
}
template <class T>
ostream& operator<<(ostream& out, vector<T> vec) {
  out << "(";
  for (auto& v : vec) out << v << ", ";
  return out << ")";
}
const int N = 5e5 + 5;
const int M = 1 << 19;
int p[N], wh[N], got[N];
int drz[2 * M + 5];
int ReadMin(int a, int b) {
  a += M;
  b += M;
  int res = min(drz[a], drz[b]);
  while (a / 2 != b / 2) {
    if (a % 2 == 0) {
      mini(res, drz[a + 1]);
    }
    if (b % 2 == 1) {
      mini(res, drz[b - 1]);
    }
    a /= 2;
    b /= 2;
  }
  return res;
}
void Upd(int a, int v) {
  a += M;
  drz[a] = v;
  a /= 2;
  while (a) {
    drz[a] = min(drz[2 * a], drz[2 * a + 1]);
    a /= 2;
  }
}
int k;
void Ciagnij(int i) {
  while (1) {
    int pp = ReadMin(1, wh[i] - 1);
    if (pp >= i + k || wh[i] == 1) {
      break;
    }
    Ciagnij(pp);
  }
  got[i] = 1;
  Upd(wh[i], 2 * N);
  cout << i << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(10);
  if (0) cout << fixed << setprecision(10);
  cin.tie(0);
  for (int i = 0; i < (2 * M + 5); ++i) {
    drz[i] = N;
  }
  int n;
  cin >> n >> k;
  for (int i = (1); i <= (n); ++i) {
    int a;
    cin >> a;
    wh[i] = a;
    Upd(a, i);
  }
  for (int i = (1); i <= (n); ++i) {
    if (got[i]) {
      continue;
    }
    Ciagnij(i);
  }
  return 0;
}
