#include <bits/stdc++.h>
using namespace std;
int n = 101;
struct cand {
  int votes;
  int last;
  int id;
};
bool operator<(cand a, cand b) {
  return (a.votes == b.votes ? a.last < b.last : a.votes > b.votes);
}
int main() {
  int n, k, m, A;
  cin >> n >> k >> m >> A;
  int rem = m - A;
  vector<int> fr(n), last(n), ans(n);
  for (int i = 0; i < A; i++) {
    int x;
    cin >> x;
    x--;
    fr[x]++;
    last[x] = i;
  }
  if (n == 1) {
    cout << 1 << endl;
    return 0;
  }
  vector<cand> a(n);
  for (int i = 0; i < n; i++) a[i] = {fr[i], last[i], i};
  sort(a.begin(), a.end());
  if (rem == 0) {
    for (int i = 0; i < n; i++) {
      ans[a[i].id] = (i < k && a[i].votes ? 1 : 3);
    }
  } else if (n == k) {
    for (int i = 0; i < n; i++)
      if (fr[i] > 0)
        ans[i] = 1;
      else
        ans[i] = 2;
  } else {
    for (int i = 0; i < n; i++) {
      int cost = 0;
      if (i < k) {
        for (int j = i + 1; j <= k; j++) cost += a[i].votes + 1 - a[j].votes;
        if (cost > rem && a[i].votes)
          ans[a[i].id] = 1;
        else
          ans[a[i].id] = 2;
      } else if (a[k - 1].votes < a[i].votes + rem)
        ans[a[i].id] = 2;
      else
        ans[a[i].id] = 3;
    }
  }
  for (int i = 0; i < n; i++) cout << ans[i] << " ";
}
