#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(nullptr);
  cout.tie(nullptr);
  long long n, k, m, a;
  cin >> n >> k >> m >> a;
  vector<long long> vot(n, 0), last(n, -1);
  for (long long i = 0; i < a; ++i) {
    long long x;
    cin >> x;
    vot[x - 1]++;
    last[x - 1] = i;
  }
  vector<bool> luck(n, false), sure(n, false);
  for (long long i = 0; i < n; ++i) {
    if (vot[i] == 0 && m == a) continue;
    vector<pair<pair<long long, long long>, long long> > G(n);
    for (long long j = 0; j < n; ++j) {
      G[j] = make_pair(make_pair(vot[j], last[j]), j);
      if (j == i && m > a) {
        G[j].first.first += m - a;
        G[j].first.second = m - 1;
      }
      G[j].first.first = -G[j].first.first;
    }
    sort(G.begin(), G.end());
    for (long long j = 0; j < k; ++j) luck[i] = (luck[i] | (G[j].second == i));
  }
  for (long long i = 0; i < n; ++i) {
    if (vot[i] == 0) continue;
    vector<long long> need;
    for (long long j = 0; j < n; ++j) {
      if (i == j) {
        continue;
      }
      long long cur = m + 1;
      if (vot[i] < vot[j] || (vot[i] == vot[j] && last[i] > last[j]))
        cur = 0;
      else
        cur = (vot[i] + 1) - vot[j];
      need.push_back(cur);
    }
    need.push_back(m + 1);
    sort(need.begin(), need.end());
    long long sum = 0;
    for (long long j = 0; j < k; ++j) sum += need[j];
    if (sum > m - a) sure[i] = 1;
  }
  for (long long i = 0; i < n; ++i)
    cout << (sure[i] ? 1 : (luck[i] ? 2 : 3)) << " ";
  return 0;
}
