#include <bits/stdc++.h>
using namespace std;
bool cmp(pair<int, int> a, pair<int, int> b) { return a.first > b.first; }
int main(void) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  int next[n], prev[n];
  pair<int, int> v[n];
  for (int i = 0; i < (int)n; i++) {
    int x;
    cin >> x;
    v[i] = make_pair(x, i);
    next[i] = i + 1, prev[i] = i - 1;
  }
  sort(v, v + n, cmp);
  vector<int> ans(n, -1);
  int turn = 0;
  for (int i = 0; i < (int)n; i++) {
    int p = v[i].second;
    if (ans[p] == -1) {
      int cnt = 0;
      ans[p] = turn;
      p = prev[p];
      while (cnt != k && p >= 0) {
        cnt++;
        ans[p] = turn;
        p = prev[p];
      }
      int q = v[i].second;
      q = next[q];
      cnt = 0;
      while (cnt != k && q < n) {
        cnt++;
        ans[q] = turn;
        q = next[q];
      }
      if (p >= 0) next[p] = q;
      if (q < n) prev[q] = p;
      turn = (turn + 1) % 2;
    }
  }
  for (int i = 0; i < (int)n; i++) {
    cout << ans[i] + 1;
  }
  cout << "\n";
}
