#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int n, k, m, team = 1, ans[N];
pair<int, int> a[N];
set<int> Set;
vector<set<int>::iterator> Vec;
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i].first);
    a[i].second = i;
    Set.insert(i);
  }
  sort(a + 1, a + 1 + n, greater<pair<int, int> >());
  for (int i = 1; i <= n; ++i)
    if (ans[a[i].second] == 0) {
      int pos = a[i].second;
      m = k;
      for (auto it = Set.lower_bound(pos); it != end(Set) && m >= 0; --m, --it)
        Vec.push_back(it);
      m = k;
      for (auto it = Set.upper_bound(pos); it != end(Set) && m > 0; --m, ++it)
        Vec.push_back(it);
      for (auto it : Vec) ans[*it] = team, Set.erase(it);
      Vec.clear();
      team = 3 - team;
    }
  for (int i = 1; i <= n; ++i) printf("%d", ans[i]);
}
