#include <bits/stdc++.h>
using namespace std;
const int N = 210;
int n, k, m, a, g[N], v[N], last[N], st[N];
int main() {
  scanf("%d%d%d%d", &n, &k, &m, &a);
  for (int i = 0; i < a; ++i) {
    scanf("%d", &g[i]);
    v[g[i]]++;
    last[g[i]] = i;
  }
  vector<pair<pair<int, int>, int> > all;
  for (int i = 1; i <= n; ++i)
    all.push_back(make_pair(make_pair(v[i], -last[i]), i));
  sort(all.begin(), all.end());
  int have = 0;
  for (int i = all.size() - 1; i >= max(0, (int)all.size() - k); --i) {
    have = all[i].first.first;
    if (!have) continue;
    int total = 0;
    if (((int)all.size()) - k - 1 < 0) {
      st[all[i].second] = 1;
      continue;
    }
    for (int j = i - 1; j >= ((int)all.size()) - k - 1; --j) {
      total += all[i].first.first - all[j].first.first + 1;
    }
    if (total > m - a) {
      st[all[i].second] = 1;
    }
  }
  for (int i = 0; i < all.size(); ++i) {
    if (st[all[i].second]) continue;
    if (all[i].first.first + m - a > have) {
      st[all[i].second] = 2;
    }
  }
  for (int i = 1; i <= n; ++i) {
    if (i > 1) printf(" ");
    if (st[i]) {
      printf("%d", st[i]);
    } else {
      printf("3");
    }
  }
  puts("");
  return 0;
}
