#include <bits/stdc++.h>
using namespace std;
const int max_N = 100 + 20;
pair<pair<int, int>, int> c[max_N];
int ans[max_N];
bool cmp(pair<pair<int, int>, int> a, pair<pair<int, int>, int> b) {
  if (a.first.first > b.first.first) return true;
  if (a.first.first == b.first.first && a.first.second < b.first.second)
    return true;
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  int n, k, m, a, g, cnt(0);
  cin >> n >> k >> m >> a;
  for (int i = 0; i < n; i++) c[i].second = i;
  for (int i = 0; i < a; i++) {
    cin >> g;
    c[g - 1].first.first++;
    c[g - 1].first.second = i;
  }
  sort(c, c + n, cmp);
  int i = 0;
  for (i; i < k; i++) {
    int temp = c[i].first.first, r = m - a;
    for (int j = i + 1; j < min(n, k + 1); j++)
      r = r - (temp - c[j].first.first + 1);
    if (!temp) {
      if (a == m)
        ans[c[i].second] = 3;
      else
        ans[c[i].second] = 2;
    } else if (n == k || r < 0) {
      ans[c[i].second] = 1;
      cnt++;
    } else
      ans[c[i].second] = 2;
  }
  for (i = k; i < n; i++) {
    if (m - a + c[i].first.first > c[k - 1].first.first)
      ans[c[i].second] = 2;
    else
      ans[c[i].second] = 3;
  }
  for (int i = 0; i < n; i++) cout << ans[i] << ' ';
  return 0;
}
