#include <bits/stdc++.h>
using namespace std;
int N, K, M, A;
pair<pair<int, int>, int> cnt[105];
int ans[105];
bool cmp(pair<pair<int, int>, int> a, pair<pair<int, int>, int> b) {
  if (a.first.first != b.first.first) return a.first.first > b.first.first;
  return a.first.second < b.first.second;
}
int main() {
  ios::sync_with_stdio(0);
  cin >> N >> K >> M >> A;
  for (int i = 1; i <= N; i++) cnt[i].second = i;
  for (int i = 0, g; i < A; i++) {
    cin >> g;
    cnt[g].first.first++;
    cnt[g].first.second = i;
  }
  sort(cnt + 1, cnt + N + 1, cmp);
  for (int i = 1; i <= N; i++) {
    if (i <= K) {
      int need = K - i + 1;
      int votes = 0;
      if (i + need > N) {
        if (cnt[i].first.first == 0)
          ans[cnt[i].second] = 3 - (M - A > 0);
        else
          ans[cnt[i].second] = 1;
      } else {
        for (int j = 1; j <= need; j++)
          votes += cnt[i].first.first - cnt[i + j].first.first + 1;
        if (votes > M - A) {
          if (cnt[i].first.first > 0)
            ans[cnt[i].second] = 1;
          else
            ans[cnt[i].second] = 3 - (M - A > 0);
        } else {
          if (cnt[i].first.first > 0)
            ans[cnt[i].second] = 2;
          else
            ans[cnt[i].second] = 3 - (M - A > 0);
        }
      }
    } else {
      int num = 0;
      for (int j = 1; j < i; j++)
        num += (cnt[i].first.first + M - A <= cnt[j].first.first);
      if (num < K)
        ans[cnt[i].second] = 2;
      else
        ans[cnt[i].second] = 3;
    }
  }
  for (int i = 1; i <= N; i++) cout << ans[i] << " ";
  cout << "\n";
  return 0;
}
