#include <bits/stdc++.h>
using namespace std;
const int N = 4004;
struct info {
  int val, id, last;
} S[N];
int n, k, m, a, x[N], u, ans[N];
bool cmp(info A, info B) {
  return A.val == B.val ? A.last < B.last : A.val > B.val;
}
int main() {
  scanf("%d%d%d%d", &n, &k, &m, &a);
  for (int i = 1; i <= n; i++) S[i] = (info){0, i, 0};
  for (int i = 1; i <= a; i++) scanf("%d", &u), S[u].val++, S[u].last = i;
  sort(S + 1, S + n + 1, cmp);
  a = m - a;
  for (int i = 1; i <= k; i++) {
    int sum = 0, cnt = 0;
    for (int j = i + 1; j <= n; j++) {
      if (sum + (S[i].val + 1 - S[j].val) <= a && cnt < k - i + 1)
        sum += S[i].val + 1 - S[j].val, cnt++;
      else
        break;
    }
    ans[S[i].id] = cnt >= k - i + 1 ? 2 : 1;
    if (!S[i].val) ans[S[i].id] = 2;
  }
  for (int i = k + 1; i <= n; i++)
    ans[S[i].id] = S[i].val + a > S[k].val ? 2 : 3;
  for (int i = 1; i <= k; i++)
    if (a == 0 && S[i].val == 0) ans[S[i].id] = 3;
  for (int i = 1; i <= n; i++) printf("%d ", ans[i]);
  return 0;
}
