#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  int n, k, m, a;
  cin >> n >> k >> m >> a;
  std::vector<int> total_votes(n, 0);
  std::vector<int> last_vote(n, 1000000000);
  for (int i = 0; i < a; i++) {
    int v;
    cin >> v;
    v--;
    total_votes[v]++;
    last_vote[v] = i;
  }
  std::vector<pair<pair<int, int>, int>> ranks(n);
  for (int i = 0; i < n; i++) {
    ranks[i] = {{-total_votes[i], last_vote[i]}, i};
  }
  sort(ranks.begin(), ranks.end());
  int rem = m - a;
  std::vector<int> ans(n, 3);
  for (int i = 0; i < k; i++) {
    int cur_votes = -ranks[i].first.first;
    int cur_indx = ranks[i].second;
    if (cur_votes || rem) {
      ans[cur_indx] = 2;
    }
    if (cur_votes && n == k) {
      ans[cur_indx] = 1;
    } else {
      int req = 0;
      for (int j = i + 1; j < k + 1 && j < n; j++) {
        req += (cur_votes + 1 - (-ranks[j].first.first));
      }
      if (req > rem && cur_votes) {
        ans[cur_indx] = 1;
      }
    }
  }
  int score_of_kth = -ranks[k - 1].first.first;
  for (int i = k; i < n; i++) {
    int cur_votes = -ranks[i].first.first;
    int cur_indx = ranks[i].second;
    if (score_of_kth + 1 - cur_votes <= rem) {
      ans[cur_indx] = 2;
    }
  }
  for (int i = 0; i < n; i++) {
    cout << ans[i] << " ";
  }
}
