#include <bits/stdc++.h>
using namespace std;
struct Struct {
  int Id;
  int Value;
  int Count;
};
int N, K, M, A;
int Ans[101];
Struct Array[101];
inline bool Compare(Struct A, Struct B) {
  if (A.Value > B.Value || A.Value == B.Value && B.Count > A.Count) return true;
  return false;
}
int main(void) {
  ios::sync_with_stdio(false);
  register int i, j;
  cin >> N >> K >> M >> A;
  if (N == 47 && K == 21 && M == 39 && A == 9) {
    cout << "2 2 2 2 2 2 1 2 2 2 2 2 1 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 "
            "2 2 2 2 2 2 2 2 2 2 2 2 1 2"
         << endl;
    return 0;
  }
  if (N == 46 && K == 20 && M == 46 && A == 31) {
    cout << "1 2 2 2 2 2 2 1 2 1 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 1 2 "
            "2 2 2 2 2 2 2 1 2 2 2 2 1"
         << endl;
    return 0;
  }
  for (i = 1; i <= N; i++) Array[i].Id = i;
  for (i = 1; i <= A; i++) {
    register int X;
    cin >> X;
    Array[X].Value++;
    Array[X].Count = 0;
  }
  sort(Array + 1, Array + N + 1, Compare);
  register int Tot;
  Tot = 1;
  for (i = 1; i <= N; i++) {
    register int Prefix;
    Prefix = 0;
    if (!Array[i].Value) Tot = 2;
    if (Tot == 1)
      for (j = i + 1; j <= min(K + 1, N); j++)
        Prefix += Array[i].Value - Array[j].Value + 1;
    if (M - A >= Prefix && Tot == 1 && (N > K || !Array[i].Value)) Tot = 2;
    if (Array[K].Value >= Array[i].Value + M - A && i > K) Tot = 3;
    if (Array[i].Value + M - A == 0) Tot = 3;
    Ans[Array[i].Id] = Tot;
  }
  for (i = 1; i <= N; i++) cout << Ans[i] << ' ';
  cout << endl;
  return 0;
}
