#include <bits/stdc++.h>
using namespace std;
struct st {
  int vote, t, num;
};
bool cmp(st p1, st p2) {
  if (p1.vote == p2.vote) return p1.t < p2.t;
  return p1.vote > p2.vote;
}
int main() {
  int n, k, m, a;
  scanf("%d %d %d %d", &n, &k, &m, &a);
  vector<st> v(n);
  for (int i = 0; i < n; i++) {
    v[i].num = i + 1;
    v[i].t = 1000000;
    v[i].vote = 0;
  }
  for (int i = 0; i < a; i++) {
    int x;
    scanf("%d", &x);
    v[x - 1].num = x;
    v[x - 1].vote++;
    v[x - 1].t = i;
  }
  sort(v.begin(), v.end(), cmp);
  int ans[102];
  for (int i = 0; i < n; i++) {
    int x = v[i].num;
    int val = v[i].vote;
    int pos = i + 1;
    int remain = m - a;
    if (val == 0) pos = k + 1;
    for (int j = i + 1; j < n; j++) {
      if (v[j].vote + remain > val) {
        pos++;
        remain -= (val - v[j].vote + 1);
      }
    }
    if (pos <= k)
      ans[x] = 1;
    else {
      pos = i + 1;
      if (m - a == 0) pos = k + 1;
      for (int j = i - 1; j >= 0; j--) {
        if (v[i].vote + m - a == 0) pos++;
        if (v[i].vote + (m - a) > v[j].vote) pos--;
      }
      if (pos <= k)
        ans[x] = 2;
      else
        ans[x] = 3;
    }
  }
  for (int i = 1; i <= n; i++) cout << ans[i] << " ";
  printf("\n");
  return 0;
}
