#include <bits/stdc++.h>
using namespace std;
int n, k, m, a, g, r[101], t = 1;
struct rua {
  int v, id, t;
} _[101];
bool cmp(rua x, rua y) { return x.v > y.v || (x.v == y.v && x.t < y.t); }
int main() {
  scanf("%d%d%d%d", &n, &k, &m, &a);
  for (int i = 1; i <= a; i++) scanf("%d", &g), _[g].v++, _[g].t = i;
  for (int i = 1; i <= n; i++) _[i].id = i;
  sort(_ + 1, _ + n + 1, cmp);
  for (int i = 1; i <= n; i++) {
    int s = 0;
    if (!_[i].v) t = 2;
    if (t == 1)
      for (int j = i + 1; j <= min(n, k + 1); j++) s += _[i].v - _[j].v + 1;
    if (s <= m - a && t == 1 && (n > k || !_[i].v)) t = 2;
    if (_[i].v + m - a <= _[k].v && i > k) t = 3;
    if (!(_[i].v + m - a)) t = 3;
    r[_[i].id] = t;
  }
  for (int i = 1; i <= n; i++) printf("%d%c", r[i], i == n ? '\n' : ' ');
  return 0;
}
