#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const int INF = 1000 * 1000 * 1000;
const long long LINF = INF * (long long)INF;
const int MAX = 707;
const int MOD = 1000000007;
int cnt[MAX];
int n, k, m, a;
int tmm[MAX];
int try_1(int id) {
  if (cnt[id] == 0) return 0;
  if (k == n) return 1;
  vector<pair<int, int> > X;
  for (int i = (0); i < (n); i++) {
    if (i != id) X.push_back(make_pair(cnt[i], -tmm[i]));
  }
  sort(X.begin(), X.end());
  reverse(X.begin(), X.end());
  int need = 0;
  for (int i = (0); i < (k); i++) {
    if (X[i].first > cnt[id]) continue;
    if (X[i].first < cnt[id]) {
      need += cnt[id] + 1 - X[i].first;
      continue;
    }
    if (-X[i].second > tmm[id]) need++;
  }
  if (need > m) return 1;
  return 0;
}
int try_2(int id) {
  int bad = 0;
  for (int i = (0); i < (n); i++) {
    if (i == id) continue;
    if (cnt[i] >= cnt[id] + m) bad++;
  }
  if (bad >= k || (m == 0 && cnt[id] == 0)) return 0;
  return 1;
}
int main(int argc, char* argv[]) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> k >> m >> a;
  for (int i = (0); i < (a); i++) {
    int x;
    cin >> x;
    cnt[x - 1]++;
    tmm[x - 1] = i;
  }
  m -= a;
  for (int i = (0); i < (n); i++) {
    if (try_1(i)) {
      cout << 1 << ' ';
    } else {
      if (try_2(i)) {
        cout << 2 << ' ';
      } else {
        cout << 3 << ' ';
      }
    }
  }
  cerr << 1.0 * clock() / CLOCKS_PER_SEC << endl;
  return 0;
}
