#include <bits/stdc++.h>
using namespace std;
int main() {
  int otm[5] = {};
  int *otms = new int[200000];
  int n;
  int a, b;
  scanf("%d%d%d", &n, &a, &b);
  for (int(i) = 0; (i) < (n); (i)++) {
    int o;
    scanf("%d", &o);
    otms[i] = o - 1;
    otm[o - 1]++;
  }
  if (a == b) {
    for (int(i) = 0; (i) < (a); (i)++) printf("%d ", 1);
    for (int(i) = 0; (i) < (a); (i)++) printf("%d ", 2);
    return 0;
  }
  int snum = 1;
  int bnum = 2;
  if (a < b) {
    swap(a, b);
    swap(snum, bnum);
  }
  int s = 0;
  int li = 0;
  for (int(i) = 0; (i) < (5); (i)++) {
    s += otm[i];
    if (s >= a) {
      li = i;
      break;
    }
  }
  for (int(i) = 0; (i) < (li); (i)++) s -= otm[i];
  for (int(i) = 0; (i) < (li); (i)++) a -= otm[i];
  int lip = 0;
  for (int(i) = 0; (i) < (n); (i)++) {
    if (otms[i] < li)
      printf("%d ", snum);
    else if (otms[i] > li)
      printf("%d ", bnum);
    else {
      if (snum < bnum) {
        if (lip < a)
          printf("%d ", snum);
        else
          printf("%d ", bnum);
      } else {
        if (lip < otm[li] - a)
          printf("%d ", bnum);
        else
          printf("%d ", snum);
      }
      lip++;
    }
  }
  return 0;
}
