#include <bits/stdc++.h>
using namespace std;
int n, k, a, m, g[105], an[105];
bool vis[105];
pair<int, pair<int, int> > pr[105];
bool comp(const pair<int, pair<int, int> > &val1,
          const pair<int, pair<int, int> > &val2) {
  if (val1.first == val2.first) {
    return (val1.second.first < val2.second.first);
  }
  return (val1.first > val2.first);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  scanf("%d%d%d%d", &n, &k, &m, &a);
  for (int i = 1, x; i <= a; i++) {
    scanf("%d", &x);
    pr[x].first++;
    pr[x].second.first = i;
    pr[x].second.second = x;
  }
  for (int i = 1; i <= n; i++)
    if (pr[i].second.second == 0) pr[i].second.second = i;
  sort(pr + 1, pr + n + 1, comp);
  for (int i = 1, tmp, cnt, lol; i <= n; i++) {
    tmp = m - a, cnt = 0;
    if (pr[i].first > 0) {
      for (int j = i + 1; j <= n; j++) {
        lol = pr[i].first - pr[j].first + 1;
        if (tmp >= lol) {
          tmp -= lol;
          cnt++;
        }
      }
      if (cnt + i - 1 < k) an[pr[i].second.second] = 1;
    }
    cnt = 0;
    if (an[pr[i].second.second] == 0 && pr[i].first + m - a > 0) {
      for (int j = 1; j <= n; j++) {
        if (i == j) continue;
        if (pr[i].first + m - a <= pr[j].first) cnt++;
      }
      if (cnt >= k) an[pr[i].second.second] = 3;
    } else if (an[pr[i].second.second] == 0)
      an[pr[i].second.second] = 3;
  }
  for (int i = 1; i <= n; i++) {
    if (an[i])
      printf("%d ", an[i]);
    else
      printf("2 ");
  }
  return 0;
}
