#include <bits/stdc++.h>
using namespace std;
int g[102], x = 0;
struct cndate {
  int cnt, lst, r, ps;
  cndate() {
    cnt = 0;
    lst = 0;
    ps = x++;
  }
} cnd[102];
bool cmp(cndate a, cndate b) {
  return a.cnt > b.cnt ? true : a.cnt < b.cnt ? false : a.lst < b.lst;
}
bool cmp1(cndate a, cndate b) { return a.ps < b.ps; }
int main() {
  int n, k, m, a;
  cin >> n >> k >> m >> a;
  for (int i = 1; i <= a; i++) {
    cin >> g[i];
    cnd[g[i]].cnt++;
    cnd[g[i]].lst = i;
  }
  sort(cnd + 1, cnd + n + 1, cmp);
  for (int i = 1; i <= n; i++) {
    int vbaki = m - a, cbaki = k - i + 1, cc = m - a;
    bool f = false;
    for (int j = i + 1; j <= i + cbaki; j++) {
      if (j > n) {
        f = true;
        break;
      }
      cc -= (cnd[i].cnt - cnd[j].cnt + 1);
      if (cc < 0) {
        f = true;
        break;
      }
    }
    if (cnd[i].cnt == 0) f = false;
    if (f)
      cnd[i].r = 1;
    else if (i <= k) {
      if (cnd[i].cnt + vbaki)
        cnd[i].r = 2;
      else
        cnd[i].r = 3;
    } else if (i > k) {
      if (cnd[i].cnt + vbaki > cnd[k].cnt) {
        cnd[i].r = 2;
      } else
        cnd[i].r = 3;
    }
  }
  sort(cnd + 1, cnd + n + 1, cmp1);
  for (int i = 1; i <= n; i++) cout << cnd[i].r << ' ';
}
