#include <bits/stdc++.h>
using namespace std;
int n, k, m, p, now, pos, vote, x;
struct Vote {
  int cnt, lst, num;
  bool operator<(const Vote &f) const {
    if (cnt == f.cnt)
      return lst < f.lst;
    else
      return cnt > f.cnt;
  }
} a[114], b[114];
void check(int now) {
  int l, i;
  for (i = 1; i <= n; i++) b[i] = a[i];
  for (pos = 1; b[pos].num != now; pos++)
    ;
  b[pos].cnt += p;
  if (p) {
    vote = m;
    b[pos].lst = m + p;
  }
  sort(b + 1, b + n + 1);
  for (pos = 1; b[pos].num != now; pos++)
    ;
  if (pos > k || b[pos].cnt == 0) {
    printf("3 ");
    return;
  }
  for (i = 1; i <= n; i++) b[i] = a[i];
  for (pos = 1; b[pos].num != now; pos++)
    ;
  for (l = p, i = pos + 1; i <= n; i++) {
    while (l && ((b[i].cnt == b[pos].cnt && b[i].lst >= b[pos].lst) ||
                 (b[i].cnt != b[pos].cnt && b[i].cnt < b[pos].cnt))) {
      b[i].cnt++;
      b[i].lst = ++vote;
      l--;
    }
    if (!l) break;
  }
  sort(b + 1, b + n + 1);
  for (pos = 1; b[pos].num != now; pos++)
    ;
  if (pos > k || b[pos].cnt == 0) {
    printf("2 ");
    return;
  }
  printf("1 ");
  return;
}
int main() {
  int i;
  scanf("%d %d %d %d", &n, &k, &p, &m);
  p -= m;
  for (i = 1; i <= m; i++) {
    scanf("%d", &x);
    a[x].cnt++;
    a[x].lst = i;
  }
  for (i = 1; i <= n; i++) a[i].num = i;
  sort(a + 1, a + n + 1);
  for (i = 1; i <= n; i++) check(i);
  return 0;
}
