#include <bits/stdc++.h>
using namespace std;
struct node {
  int pos, val, tme;
  bool operator<(const node &a) const {
    if (val == a.val) return tme < a.tme;
    return val > a.val;
  }
} p[110];
int cnt[110];
int main() {
  int n, x, m, a, pi;
  scanf("%d%d%d%d", &n, &x, &m, &a);
  for (int i = 1; i <= a; i++) scanf("%d", &pi), p[pi].val++, p[pi].tme = i;
  for (int i = 1; i <= n; i++) cnt[i] = p[i].val, p[i].pos = i;
  sort(p + 1, p + 1 + n);
  for (int i = 1; i <= n; i++) {
    int t = cnt[i] + m - a;
    bool flag = false;
    for (int j = 1; j <= x; j++) {
      if (p[j].pos == i) {
        if (t == 0)
          ;
        else {
          flag = true;
          break;
        }
      } else {
        if (t > p[j].val) {
          flag = true;
          break;
        }
      }
    }
    if (!flag) {
      printf("3 ");
      continue;
    }
    int pos_i = 1;
    for (; p[pos_i].pos != i; pos_i++)
      ;
    if (pos_i > x) {
      printf("2 ");
      continue;
    }
    int remain = m - a, grade = pos_i;
    for (int j = pos_i + 1; j <= n && remain > 0; j++) {
      if (p[pos_i].val - p[j].val + 1 <= remain) {
        remain -= p[pos_i].val - p[j].val + 1;
        grade++;
      } else
        break;
    }
    if (grade <= x && p[pos_i].val != 0)
      printf("1 ");
    else
      printf("2 ");
  }
  return 0;
}
