#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, m, a;
  cin >> n >> k >> m >> a;
  vector<int> cand_votes(n, 0), last_vote_time(n, -1);
  vector<int> vote(a);
  for (int i = 0; i < a; i++) {
    int cand;
    cin >> cand;
    vote[i] = cand;
    cand_votes[cand - 1]++;
    last_vote_time[cand - 1] = i;
  }
  vector<int> answer(n, 2);
  for (int i = 0; i < n; i++) {
    int rem_votes = m - a;
    int all_goes_well = cand_votes[i] + rem_votes;
    int last_time;
    if (rem_votes > 0)
      last_time = m - 1;
    else
      last_time = last_vote_time[i];
    int pos = 0;
    for (int j = 0; j < n; j++) {
      if (i != j &&
          ((cand_votes[j] > all_goes_well) ||
           (cand_votes[j] == all_goes_well && last_vote_time[j] < last_time)))
        pos++;
    }
    if (pos >= k || all_goes_well == 0) {
      answer[i] = 3;
    } else {
      vector<pair<int, int>> cand(n);
      for (int j = 0; j < n; j++) cand[j] = {cand_votes[j], j};
      swap(cand[i], cand[cand.size() - 1]);
      cand.pop_back();
      if (!cand.empty())
        sort(cand.begin(), cand.end(), greater<pair<int, int>>());
      int j = 0, taken_seats = 0, nr_get_out = 0;
      while (j < n && taken_seats < k) {
        if (cand[j].second != i) {
          if (cand[j].first > cand_votes[i] ||
              (cand[j].first == cand_votes[i] &&
               last_vote_time[cand[j].second] < last_vote_time[i])) {
            taken_seats++;
          } else {
            while (cand[j].first <= cand_votes[i]) {
              cand[j].first++;
              nr_get_out++;
            }
            taken_seats++;
          }
        }
        j++;
      }
      if (cand_votes[i] > 0 && (nr_get_out > m - a || taken_seats < k)) {
        answer[i] = 1;
      }
    }
  }
  for (int i = 0; i < n; i++) cout << answer[i] << " ";
  cout << "\n";
  return 0;
}
