#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e2 + 1;
int n, k, m, a, cnt[maxn], last[maxn], id[maxn], res[maxn];
void Enter() {
  cin >> n >> k >> m >> a;
  for (int i = 1; i <= a; ++i) {
    int g;
    cin >> g;
    ++cnt[g];
    last[g] = i;
  }
}
void Init() {
  for (int i = 1; i <= n; ++i) id[i] = i;
  sort(id + 1, id + n + 1, [](int i, int j) {
    return cnt[i] > cnt[j] || (cnt[i] == cnt[j] && last[i] < last[j]);
  });
}
void Solve() {
  if (k == n) {
    for (int i = 1; i <= n; ++i)
      if (cnt[i] == 0)
        if (m == a)
          cout << 3 << ' ';
        else
          cout << 2 << ' ';
      else
        cout << 1 << ' ';
    return;
  }
  int s = 0;
  for (int i = 1; i <= k + 1; ++i) s += cnt[id[i]];
  for (int t = 1; t <= k; ++t) {
    int i = id[t];
    s -= cnt[i];
    if (cnt[i] != 0)
      if ((cnt[i] + 1) * (k + 1 - t) - s <= m - a)
        res[i] = 2;
      else
        res[i] = 1;
    else if (m == a)
      res[i] = 3;
    else
      res[i] = 2;
  }
  for (int t = k + 1; t <= n; ++t) {
    int i = id[t];
    if (cnt[i] + (m - a) <= cnt[id[k]])
      res[i] = 3;
    else
      res[i] = 2;
  }
  for (int i = 1; i <= n; ++i) cout << res[i] << ' ';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  Enter();
  Init();
  Solve();
}
