#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  pair<long long, long long> p[n];
  for (long long i = 0; i < n; i++) {
    cin >> p[i].first;
    p[i].second = i;
  }
  sort(p, p + n);
  reverse(p, p + n);
  set<long long> s;
  for (long long i = 0; i < n; i++) {
    s.insert(i);
  }
  long long i = 0;
  vector<long long> v(n);
  long long f = 0;
  while (i < n) {
    while (!s.count(p[i].second) && i < n) {
      i++;
    }
    if (i == n) {
      break;
    }
    set<long long>::iterator it = s.find(p[i].second);
    vector<long long> t1;
    for (long long j = 0; j <= k; j++) {
      t1.push_back(*it);
      if (it != s.begin()) {
        it--;
      } else {
        break;
      }
    }
    it = next(s.find(p[i].second));
    for (long long j = 0; j < k; j++) {
      if (it != s.end()) {
        t1.push_back(*it);
        it++;
      } else {
        break;
      }
    }
    for (long long i = 0; i < (long long)t1.size(); i++) {
      v[t1[i]] = f;
      s.erase(t1[i]);
    }
    f ^= 1;
  }
  for (long long i = 0; i < n; i++) {
    cout << v[i] + 1;
  }
}
