#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 200100;
const long long INF = 2000000100;
const long long MOD = 998244353;
int N, K, A[MAXN], ans[MAXN];
priority_queue<pair<int, int> > PQ;
int nb[MAXN][2];
int corr(int n, int k, bool s, int team) {
  if (k == 0 || n == 0 || n == N + 1) return n;
  if (ans[n] == 0) {
    ans[n] = team;
    nb[n][s] = corr(nb[n][s], k - 1, s, team);
  } else {
    nb[n][s] = corr(nb[n][s], k, s, team);
  }
  return nb[n][s];
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> N >> K;
  for (int i = 1; i <= N; i++) {
    cin >> A[i];
    PQ.push(pair<int, int>(A[i], i));
    nb[i][0] = i - 1;
    nb[i][1] = i + 1;
  }
  int team = 1;
  while (!PQ.empty()) {
    int t = PQ.top().second;
    PQ.pop();
    if (ans[t] != 0) continue;
    ans[t] = team;
    nb[t][0] = corr(t - 1, K, 0, team);
    nb[t][1] = corr(t + 1, K, 1, team);
    team = 3 - team;
  }
  for (int i = 1; i <= N; i++) cout << ans[i];
  cout << "\n";
}
