#include <bits/stdc++.h>
using namespace std;
int g[110];
int la[110], cn[110];
pair<int, pair<int, int> > pa[110], pp[110];
int n, k, m, a;
int get3(int j) {
  for (int i = 0; i < n; i++) {
    pp[i] = make_pair(-cn[i], make_pair(la[i], i));
  }
  if (m > a) {
    pp[j].first -= m - a;
    pp[j].second.first = m - 1;
  }
  if (!pp[j].first) return 0;
  sort(pp, pp + n);
  for (int i = 0; i < k; i++) {
    if (pp[i].second.second == j) return 1;
  }
  return 0;
}
int main() {
  scanf("%d%d%d%d", &n, &k, &m, &a);
  for (int i = 0; i < a; i++) {
    scanf("%d", &g[i]);
    --g[i];
    la[g[i]] = i;
    cn[g[i]]++;
  }
  for (int i = 0; i < n; i++) {
    pa[i] = make_pair(-cn[i], make_pair(la[i], i));
  }
  sort(pa, pa + n);
  for (int i = 0; i < n; i++) {
    if (!get3(i)) {
      printf("3 ");
      continue;
    }
    int re = m - a, f = 0, x = 0;
    for (int j = 0; j < n; j++) {
      if (pa[j].second.second == i) {
        f = 1;
        continue;
      }
      if (!f) {
        x++;
        continue;
      }
      int y = -pa[j].first;
      int to = cn[i] + 1 - y;
      if (re >= to) {
        re -= to;
        x++;
      }
    }
    if (x < k && cn[i] != 0) {
      printf("1 ");
    } else {
      printf("2 ");
    }
  }
  return 0;
}
