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;
int rd() {
  int sum = 0;
  char c = getchar();
  bool flag = true;
  while (c < '0' || c > '9') {
    if (c == '-') flag = false;
    c = getchar();
  }
  while (c >= '0' && c <= '9') sum = sum * 10 + c - 48, c = getchar();
  if (flag)
    return sum;
  else
    return -sum;
}
const int p = 1e9 + 7;
const int INF = 1e9;
int n, k;
int a[501000], b[501000], du[501000];
int tr[2001000];
int linkk[501000], t;
struct node {
  int n, y;
} e[1001000];
void add(int root, int l, int r, int pl, int v) {
  if (l == r) {
    tr[root] = v;
    return;
  }
  int mid = l + r >> 1;
  if (pl <= mid)
    add(root * 2, l, mid, pl, v);
  else
    add(root * 2 + 1, mid + 1, r, pl, v);
  tr[root] = min(tr[root * 2], tr[root * 2 + 1]);
}
void dele(int root, int l, int r, int pl) {
  if (l == r) {
    tr[root] = INF;
    return;
  }
  int mid = l + r >> 1;
  if (pl <= mid)
    dele(root * 2, l, mid, pl);
  else
    dele(root * 2 + 1, mid + 1, r, pl);
  tr[root] = min(tr[root * 2], tr[root * 2 + 1]);
}
int ask(int root, int l, int r, int x, int y) {
  if (l > y || r < x) return INF;
  if (x <= l && r <= y) return tr[root];
  int mid = l + r >> 1;
  return min(ask(root * 2, l, mid, x, y), ask(root * 2 + 1, mid + 1, r, x, y));
}
void insert(int x, int y) {
  e[++t].y = y;
  e[t].n = linkk[x];
  linkk[x] = t;
  du[y]++;
}
priority_queue<int> q;
int main() {
  n = rd();
  k = rd();
  for (int i = 1; i <= n; ++i) a[i] = rd(), b[a[i]] = i;
  memset(tr, 10, sizeof(tr));
  if (k == 1) {
    for (int i = 1; i <= n; ++i) printf("%d\n", i);
    return 0;
  }
  for (int i = 1; i <= n; ++i) add(1, 1, n, i, a[i]);
  for (int i = 1; i <= n; ++i) {
    int t = ask(1, 1, n, b[i] - k + 1, b[i] - 1);
    if (t > i && t != INF) insert(b[i], b[t]);
    t = ask(1, 1, n, b[i] + 1, b[i] + k);
    if (t > i && t != INF) insert(b[i], b[t]);
    dele(1, 1, n, b[i]);
  }
  for (int i = 1; i <= n; ++i)
    if (du[i] == 0) q.push(-i);
  while (!q.empty()) {
    printf("%d\n", -q.top());
    int x = -q.top();
    q.pop();
    for (int i = linkk[x]; i; i = e[i].n) {
      du[e[i].y]--;
      if (du[e[i].y] == 0) q.push(-e[i].y);
    }
  }
  return 0;
}
