#include <bits/stdc++.h>
using namespace std;
struct Cand {
  int id, v, l;
  bool operator<(const Cand& rhs) const {
    if (v == rhs.v) return l < rhs.l;
    return v > rhs.v;
  }
};
int main() {
  int n, k, m, a;
  cin >> n >> k >> m >> a;
  Cand cand[n];
  for (int i = 0; i < n; i++) {
    cand[i].id = i + 1;
    cand[i].v = 0;
    cand[i].l = 0;
  }
  for (int i = 0; i < a; i++) {
    int c;
    cin >> c;
    cand[c - 1].v++;
    cand[c - 1].l = i;
  }
  sort(cand, cand + n);
  int ans[n + 1];
  for (int i = 0; i < n; i++) {
    int lst = m - a;
    if (cand[i].v == 0 && lst == 0) {
      ans[cand[i].id] = 3;
      continue;
    }
    int np = k - i;
    if (np > 0) {
      int j;
      for (j = 1; j <= np; j++) {
        int jj = i + j;
        if (jj >= n) break;
        lst -= cand[i].v - cand[jj].v + 1;
        if (lst < 0) break;
      }
      j--;
      if (j == np || cand[i].v == 0)
        ans[cand[i].id] = 2;
      else
        ans[cand[i].id] = 1;
    } else {
      if (cand[k - 1].v - cand[i].v + 1 <= lst)
        ans[cand[i].id] = 2;
      else
        ans[cand[i].id] = 3;
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << ans[i] << " ";
  }
  cout << endl;
}
