#include <bits/stdc++.h>
using namespace std;
const long long inf = (long long)1e18;
const long long mod = (long long)1e9 + 7;
const double pi = acos(-1.0);
const double eps = (double)1e-9;
const int dx[] = {0, 0, 1, 0, -1};
const int dy[] = {0, 1, 0, -1, 0};
const int N = 100500;
int last[N], old[N], cnt[N], m, a, n, k;
bool loss(int j) {
  cnt[j] += m - a;
  if (m - a) last[j] = m;
  vector<pair<pair<int, int>, int> > v;
  for (int i = 1; i <= n; ++i)
    v.push_back(make_pair(make_pair(-cnt[i], last[i]), i));
  sort(v.begin(), v.end());
  bool res = 0;
  for (int i = 0; i < n; ++i) {
    if (v[i].second == j) {
      if (!cnt[j] || i >= k) res = 1;
    }
  }
  last[j] = old[j];
  cnt[j] -= m - a;
  return res;
}
bool win(int j) {
  int pos = 0;
  vector<pair<pair<int, int>, int> > v;
  for (int i = 1; i <= n; ++i)
    v.push_back(make_pair(make_pair(-cnt[i], last[i]), i));
  sort(v.begin(), v.end());
  for (int i = a + 1; i <= m; ++i) {
    for (int q = 0; q < n; ++q)
      if (v[q].second == j) pos = q;
    if (pos != n - 1) {
      v[pos + 1].first.first--;
      v[pos + 1].first.second = i;
    }
    sort(v.begin(), v.end());
  }
  for (int i = 0; i < n; ++i)
    if (v[i].second == j) pos = i;
  bool res = 0;
  if (v[pos].first.first && pos < k) res = 1;
  return res;
}
int main() {
  cin >> n >> k >> m >> a;
  for (int i = 1; i <= a; ++i) {
    int x;
    cin >> x;
    cnt[x]++;
    last[x] = i;
    old[x] = i;
  }
  for (int i = 1; i <= n; ++i) {
    int w = win(i), l = loss(i);
    if (w && l)
      cout << 2;
    else if (w)
      cout << 1;
    else if (l)
      cout << 3;
    else
      cout << 2;
    cout << " ";
  }
  return 0;
}
