#include <bits/stdc++.h>
using namespace std;
struct node {
  int number, id, fina;
} pro[200];
int n, m, k, a;
int ans[200];
bool cmp(const node &t, const node &o) {
  if (t.number == o.number) return t.fina < o.fina;
  return t.number > o.number;
}
int check(int id) {
  if (id <= k && pro[id].number) {
    int need = 0, t = k - id + 1, j = 1;
    while (t--) {
      need += pro[id].number - pro[id + j].number + 1;
      j++;
    }
    return need > m - a || k == n ? 1 : 2;
  }
  if (pro[id].number + (m - a) > pro[k].number) return 2;
  return 3;
}
int main(void) {
  scanf("%d%d%d%d", &n, &k, &m, &a);
  for (int i = 1; i <= n; ++i) pro[i].number = 0, pro[i].id = i;
  for (int i = 1; i <= a; ++i) {
    int x;
    scanf("%d", &x);
    pro[x].number++;
    pro[x].fina = i;
  }
  sort(pro + 1, pro + 1 + n, cmp);
  for (int i = 1; i <= n; ++i) ans[pro[i].id] = check(i);
  for (int i = 1; i <= n; ++i) printf("%d ", ans[i]);
  return 0;
}
