#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, m, a;
  cin >> n >> k >> m >> a;
  set<pair<pair<long long, long long>, long long>,
      greater<pair<pair<long long, long long>, long long>>>
      s;
  vector<set<pair<pair<long long, long long>, long long>,
             greater<pair<pair<long long, long long>, long long>>>::iterator>
      sIts(n, s.end());
  for (long long i = (long long)(0); i < (long long)(a); i++) {
    long long vot;
    cin >> vot;
    vot--;
    long long count = 0;
    if (sIts[vot] != s.end()) {
      count = sIts[vot]->first.first;
      s.erase(sIts[vot]);
    }
    sIts[vot] = s.insert({{count + 1, -i}, vot}).first;
  }
  for (long long i = (long long)(0); i < (long long)(n); i++) {
    if (sIts[i] != s.end()) continue;
    sIts[i] = s.insert({{0, -a}, i}).first;
  }
  vector<bool> gana(n, false);
  vector<bool> pierde(n, false);
  long long faltan = m - a;
  ;
  long long minWinVotes = 0;
  long long i = 0;
  for (auto it = s.begin(); it != s.end(); it++, i++) {
    long long cand = it->second;
    long long votos = it->first.first;
    ;
    ;
    ;
    if (i < k and votos > 0) {
      gana[cand] = true;
      if (i == k - 1) {
        minWinVotes = votos + 1;
        ;
      }
      auto itt = it;
      long long tieneBajar = k - i;
      long long faltanTmp = faltan;
      itt++;
      while (itt != s.end()) {
        long long esteNecesita = votos + 1 - itt->first.first;
        if (esteNecesita > faltanTmp) {
          break;
        }
        faltanTmp -= esteNecesita;
        tieneBajar--;
        if (tieneBajar == 0) {
          pierde[cand] = true;
          break;
        }
        itt++;
      }
    } else {
      pierde[cand] = true;
      ;
      if (votos + faltan >= minWinVotes and faltan > 0) gana[cand] = true;
    };
    ;
  }
  for (long long i = (long long)(0); i < (long long)(n); i++) {
    if (gana[i] and pierde[i])
      cout << 2;
    else if (gana[i])
      cout << 1;
    else
      cout << 3;
    if (i + 1 < n) cout << " ";
  }
  cout << endl;
  return 0;
}
