#include <bits/stdc++.h>
using namespace std;
const int maxn = 111;
int votes[maxn];
int last[maxn], ans[maxn], id[maxn];
int cmp(int i, int j) {
  if (votes[i] != votes[j]) return votes[i] > votes[j];
  return last[i] < last[j];
}
int main() {
  int n, k, m, a;
  scanf("%d%d%d%d", &n, &k, &m, &a);
  for (int i = 1; i <= a; i++) {
    int tmp;
    scanf("%d", &tmp);
    votes[tmp]++;
    last[tmp] = i;
  }
  if (n == 1) {
    printf("1\n");
    return 0;
  }
  for (int i = 1; i <= n; i++) id[i] = i;
  for (int i = 1; i <= n; i++) {
    if (k == n) {
      if (votes[i])
        ans[i] = 1;
      else if (m - a)
        ans[i] = 2;
      else
        ans[i] = 3;
      continue;
    }
    votes[i] += m - a;
    if (votes[i] == 0) {
      ans[i] = 3;
      continue;
    }
    int tmp = last[i];
    if (m - a) last[i] = m;
    sort(id + 1, id + n + 1, cmp);
    int flg = 0;
    for (int j = 1; j <= k; j++)
      if (id[j] == i) flg = 1;
    votes[i] -= m - a;
    last[i] = tmp;
    if (flg == 0)
      ans[i] = 3;
    else {
      sort(id + 1, id + n + 1, cmp);
      int need = 0, tar = votes[i];
      flg = 0;
      if (votes[i] == 0) {
        ans[i] = 2;
        continue;
      }
      for (int j = 1; j <= k + 1; j++) {
        if (need) {
          need += tar - votes[id[j]] + 1;
          continue;
        }
        if (id[j] == i) need = 1, flg = 1;
      }
      need--;
      if (flg == 0 or need <= m - a)
        ans[i] = 2;
      else
        ans[i] = 1;
    }
  }
  for (int i = 1; i <= n; i++) printf("%d%c", ans[i], " \n"[i == n]);
  return 0;
}
