#include <bits/stdc++.h>
using namespace std;
int n, k, m, a, num[110], ti[110], flag[110];
struct node {
  int id, val, tim;
} hm[110];
int cmp(node a, node b) {
  if (a.val != b.val)
    return a.val > b.val;
  else
    return a.tim < b.tim;
}
int main() {
  scanf("%d%d%d%d", &n, &k, &m, &a);
  for (int i = 1; i <= a; i++) {
    int x;
    scanf("%d", &x);
    num[x]++;
    ti[x] = i;
  }
  for (int i = 1; i <= n; i++) {
    hm[i].id = i;
    hm[i].val = num[i];
    hm[i].tim = ti[i];
  }
  sort(hm + 1, hm + n + 1, cmp);
  for (int i = 1; i <= n; i++) {
    int al = 0, use = 0;
    if (!num[i]) continue;
    for (int j = 1; j <= n; j++)
      if (i != hm[j].id) {
        if (hm[j].val > num[i] || (num[i] == hm[j].val && hm[j].tim < ti[i]))
          al++;
        else if (use + num[i] - hm[j].val + 1 <= m - a) {
          al++;
          use += num[i] - hm[j].val + 1;
        }
      }
    if (al < k) flag[i] = 1;
  }
  for (int i = 1; i <= n; i++)
    if (!flag[i]) {
      int x = num[i] + m - a, cnt = 0;
      int T = ti[i];
      if (m - a > 0) T = m;
      if (!x) {
        flag[i] = 3;
        continue;
      }
      for (int j = 1; j <= n; j++)
        if (hm[j].id != i) {
          if (hm[j].val > x || (hm[j].val == x && hm[j].tim < T)) cnt++;
        }
      if (cnt < k)
        flag[i] = 2;
      else
        flag[i] = 3;
    }
  for (int i = 1; i <= n; i++)
    if (i < n)
      printf("%d ", flag[i]);
    else
      printf("%d\n", flag[i]);
  return 0;
}
