#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int n, k, m, a, x;
int v[N], sp[N], poz[N];
pair<int, pair<int, int> > s[N];
bool cmp(pair<int, pair<int, int> > _x, pair<int, pair<int, int> > _y) {
  return _x.first < _y.first ||
         _x.first == _y.first && _x.second.first > _y.second.first;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k >> m >> a;
  if (n == 1) {
    cout << 1;
    return 0;
  }
  for (int i = 1; i <= a; ++i) {
    cin >> x;
    ++v[x];
    ++s[x].first;
    s[x].second.first = i;
  }
  for (int i = 1; i <= n; ++i) s[i].second.second = i;
  sort(s + 1, s + n + 1, cmp);
  for (int i = 1; i <= n; ++i) {
    sp[i] = sp[i - 1] + s[i].first;
    poz[s[i].second.second] = i;
  }
  if (a == m) {
    for (int i = 1; i <= n; ++i) {
      if (poz[i] > n - k && v[i] > 0)
        cout << 1 << ' ';
      else
        cout << 3 << ' ';
    }
    return 0;
  }
  if (n <= k) {
    for (int i = 1; i <= n; ++i) {
      if (v[i])
        cout << 1 << ' ';
      else if (m > a)
        cout << 2 << ' ';
      else
        cout << 3 << ' ';
    }
    return 0;
  }
  for (int i = 1; i <= n; ++i) {
    if (v[i] + m - a <= s[n - k + 1].first) {
      cout << 3 << ' ';
    } else if (m - a + sp[poz[i] - 1] - sp[max(n - k - 1, 0)] <
                   (poz[i] - (n - k)) * (v[i] + 1) &&
               v[i]) {
      cout << 1 << ' ';
    } else
      cout << 2 << ' ';
  }
  return 0;
}
