#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<pair<int, int>> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i].first;
    a[i].second = i;
  }
  sort(a.rbegin(), a.rend());
  queue<int> q;
  for (int i = 0; i < n; ++i) {
    q.push(a[i].second);
  }
  set<int> index;
  for (int i = 0; i < n; ++i) index.insert(i);
  string asw(n, '0');
  int fellow = 0;
  while (!index.empty()) {
    while (!index.count(q.front())) q.pop();
    int pos = q.front();
    q.pop();
    vector<int> add;
    auto it = index.find(pos);
    for (int i = 0; i <= k; ++i) {
      add.push_back(*it);
      if (it == index.begin()) break;
      --it;
    }
    it = next(index.find(pos));
    for (int i = 0; i < k; ++i) {
      if (it == index.end()) break;
      add.push_back(*it);
      ++it;
    }
    for (auto it : add) {
      asw[it] = '1' + fellow;
      index.erase(it);
    }
    fellow = fellow xor 1;
  }
  cout << asw << endl;
  return 0;
}
