#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const double pi = acos(-1.0);
const int mod = 1e9 + 7;
const int INF = 0x3f3f3f3f;
int v[10], f[100010];
int main() {
  int n, a, b;
  cin >> n >> a >> b;
  for (int i = 0; i < n; i++) {
    cin >> f[i];
    v[f[i]]++;
  }
  if (a == b) {
    for (int i = 0; i < n / 2; i++) cout << "1 ";
    for (int i = 0; i < n / 2; i++) cout << "2 ";
  } else {
    int sum = 0;
    if (a > b) {
      for (int i = 1; i <= 5; i++) {
        sum += v[i];
        if (sum > a) {
          sum -= a;
          v[i] -= sum;
          for (int j = i + 1; j <= 5; j++) v[j] = 0;
          break;
        }
      }
    } else {
      for (int i = 5; i >= 1; i--) {
        sum += v[i];
        if (sum > a) {
          sum -= a;
          v[i] -= sum;
          for (int j = i - 1; j >= 1; j--) v[j] = 0;
          break;
        }
      }
    }
    for (int i = 0; i < n; i++) {
      if (v[f[i]]) {
        cout << "1 ";
        v[f[i]]--;
      } else
        cout << "2 ";
    }
  }
  return 0;
}
