#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vvl = vector<vl>;
using vb = vector<bool>;
using vs = vector<string>;
using pll = pair<ll, ll>;
using vpll = vector<pll>;
const ll oo = 0x3f3f3f3f3f3f3f3fLL;
const double eps = 1e-9;
int main() {
  cin.sync_with_stdio(0);
  ll n, k, m, a;
  cin >> n >> k >> m >> a;
  vpll cand(n);
  for (ll i = (0); i < (a); i++) {
    ll g;
    cin >> g;
    g--;
    cand[g].first++;
    cand[g].second = -i;
  }
  vector<pair<pll, ll>> ranking;
  for (ll i = (0); i < (n); i++) {
    ranking.emplace_back(cand[i], i);
  }
  sort(begin(ranking), end(ranking), greater<pair<pll, ll>>());
  ll limit = ranking[k - 1].first.first;
  vl res(n);
  for (ll i = (0); i < (n); i++) {
    ll best = ranking[i].first.first + m - a;
    ll idx = ranking[i].second;
    if (best > limit) {
      res[idx] = 2;
    } else {
      res[idx] = 3;
    }
  }
  for (ll i = (0); i < (k); i++) {
    ll idx = ranking[i].second;
    if (!ranking[i].first.first && !(m - a)) {
      res[idx] = 3;
      continue;
    }
    if (k == n) {
      if (!ranking[i].first.first) {
        if (!(m - a)) {
          res[idx] = 3;
        } else {
          res[idx] = 2;
        }
      } else {
        res[idx] = 1;
      }
      continue;
    }
    ll spent = 0;
    for (ll j = (i + 1); j < (k + 1); j++) {
      ll give = ranking[i].first.first - ranking[j].first.first + 1;
      spent += give;
    }
    if (spent > m - a) {
      if (ranking[i].first.first) {
        res[idx] = 1;
      } else {
        if (m - a) {
          res[idx] = 2;
        } else {
          res[idx] = 3;
        }
      }
    } else {
      res[idx] = 2;
    }
  }
  for (ll i : res) {
    cout << i << ' ';
  }
  cout << endl;
}
