#include <bits/stdc++.h>
using namespace std;
const int N = 310;
int ans[N];
int main() {
  ios::sync_with_stdio(false);
  int n, k, m, a;
  cin >> n >> k >> m >> a;
  vector<tuple<int, int, int>> vot(n);
  for (int i = 0; i < n; i++) {
    get<2>(vot[i]) = i;
  }
  for (int i = 0; i < a; i++) {
    int g;
    cin >> g;
    g--;
    get<0>(vot[g])--;
    get<1>(vot[g]) = i;
  }
  sort(begin(vot), end(vot));
  for (int i = 0; i < n; i++) {
    get<0>(vot[i]) *= -1;
  }
  for (int i = 0; i < n; i++) {
    int votes, last, id;
    tie(votes, last, id) = vot[i];
    if (i >= k && votes + (m - a) <= get<0>(vot[k - 1])) {
      ans[id] = 3;
    } else {
      if (i >= k) {
        ans[id] = 2;
      } else {
        if (n == k) {
          if (votes || ((m - a) > 0 && k == 1)) {
            ans[id] = 1;
          } else {
            if ((m - a) > 0) {
              ans[id] = 2;
            } else {
              ans[id] = 3;
            }
          }
        } else {
          int need = 0;
          for (int j = i + 1; j <= k; j++) {
            need += votes + 1 - get<0>(vot[j]);
          }
          if (need > (m - a)) {
            if (votes)
              ans[id] = 1;
            else
              ans[id] = (m - a) ? 2 : 3;
          } else {
            if (votes || (m - a))
              ans[id] = 2;
            else
              ans[id] = 3;
          }
        }
      }
    }
  }
  for (int i = 0; i < n; i++) {
    cout << ans[i] << " ";
  }
  cout << "\n";
  return 0;
}
