#include <bits/stdc++.h>
using namespace std;
void solve() {}
const long long maxn = 100500;
long long n, a, b;
long long ans[maxn];
long long used[4];
deque<long long> dq[7];
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> a >> b;
  for (long long i = 1; i <= n; i++) {
    long long t;
    cin >> t;
    dq[t].emplace_back(i);
  }
  if (a == b) {
    for (long long i = 1; i <= n / 2; i++) {
      cout << 1 << " ";
    }
    for (long long i = 1; i <= n / 2; i++) {
      cout << 2 << " ";
    }
    cout << '\n';
    exit(0);
  }
  for (long long i = 1; i <= 5; i++) {
    sort((dq[i]).begin(), (dq[i]).end());
  }
  for (long long _ = 1; _ <= n; _++) {
    long long use;
    if ((a < b) and (used[1] < a)) {
      use = 1;
    } else if (used[2] < b) {
      use = 2;
    } else {
      assert(used[1] < a);
      use = 1;
    }
    long long ind = -1;
    for (long long i = 5; i >= 1; i--) {
      if ((long long)dq[i].size()) {
        if (use == 1) {
          ind = dq[i].front();
          dq[i].pop_front();
        } else {
          ind = dq[i].back();
          dq[i].pop_back();
        }
        break;
      }
    }
    assert(ind != -1);
    ans[ind] = use;
    used[use]++;
  }
  for (long long i = 1; i <= n; i++) {
    cout << ans[i] << " ";
  }
  cout << '\n';
}
