#include <bits/stdc++.h>
using namespace std;
int n, k, m, a;
int c[128];
int l[128];
vector<pair<pair<int, int>, int> > w;
int p[128];
int doit(int e) {
  if (a == m) {
    if (!c[e]) return 3;
    return p[e] < k ? 1 : 3;
  }
  if (n == 1) return 1;
  if (n == k) return c[e] ? 1 : 2;
  int s = w[k - 1].first.first;
  if (c[e] + m - a <= s) return 3;
  if (!c[e]) return 2;
  if (p[e] >= k) return 2;
  int q = 0;
  for (int i = p[e] + 1, ThxDem = k + 1; i < ThxDem; ++i)
    q += c[e] - w[i].first.first + 1;
  return q <= m - a ? 2 : 1;
}
int main() {
  scanf("%d%d%d%d", &n, &k, &m, &a);
  memset(l, -1, sizeof(l));
  for (int i = 0, ThxDem = a; i < ThxDem; ++i) {
    int x;
    scanf("%d", &x);
    x--;
    c[x]++;
    l[x] = i;
  }
  for (int i = 0, ThxDem = n; i < ThxDem; ++i)
    w.push_back(make_pair(make_pair(-c[i], l[i]), i));
  sort(w.begin(), w.end());
  for (int i = 0, ThxDem = n; i < ThxDem; ++i) w[i].first.first *= -1;
  for (int i = 0, ThxDem = n; i < ThxDem; ++i) p[w[i].second] = i;
  for (int i = 0, ThxDem = n; i < ThxDem; ++i) {
    if (i) putchar(' ');
    printf("%d", doit(i));
  }
  puts("");
  return 0;
}
