#include <bits/stdc++.h>
using namespace std;
const int maxN = 101;
struct TPerson {
  int val, last, s, ans;
} _p[maxN];
typedef TPerson* PPerson;
vector<PPerson> v;
int s[maxN], n, k, m, a, g;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k >> m >> a;
  for (int i = 1; i <= a; ++i) cin >> g, ++_p[g].val, _p[g].last = i;
  v.resize(n);
  auto p = _p;
  for (auto& t : v) t = ++p;
  sort(v.begin(), v.end(), [](const PPerson a, const PPerson b) {
    return a->val > b->val || a->val == b->val && a->last < b->last;
  });
  auto it = v.begin();
  (*it)->s = (*it)->val;
  while (++it != v.end()) (*it)->s = (*(it - 1))->s + (*it)->val;
  PPerson q = new TPerson;
  for (auto it = v.begin(); it != v.end(); ++it) {
    q->val = (*it)->val + m - a;
    if (q->val == 0) {
      (*it)->ans = 3;
      continue;
    }
    auto pos = upper_bound(
        v.begin(), it, q,
        [](const PPerson a, const PPerson b) { return a->val > b->val; });
    if (pos - v.begin() >= k) {
      (*it)->ans = 3;
      continue;
    }
    int low = it - v.begin() + 1, high = v.size() - 1, mid;
    while (low <= high) {
      mid = low + high >> 1;
      if (((*it)->val + 1) * int(v.begin() + mid - it) - v[mid]->s + (*it)->s <=
          m - a)
        low = mid + 1;
      else
        high = mid - 1;
    }
    if (low <= k && (*it)->val)
      (*it)->ans = 1;
    else
      (*it)->ans = 2;
  }
  for (int i = 1; i <= n; ++i) cout << _p[i].ans << ' ';
  return 0;
}
