#include <bits/stdc++.h>
using namespace std;
ifstream fin("p.in");
ofstream fout("p.out");
int nr_cand, nr_cet, nr_vot, nr_loc;
struct candidat {
  int ind;
  int ct_vot;
  int ap;
};
candidat c[101];
int canWin(int poz) {
  int nr_v_ram = nr_cet - nr_vot;
  if (poz <= nr_loc && (c[poz].ct_vot > 0 || nr_cet > nr_vot)) return 1;
  if (c[nr_loc].ct_vot < nr_v_ram + c[poz].ct_vot) return 1;
  return 0;
}
int canLose(int poz) {
  if (c[poz].ct_vot == 0) return 1;
  if (poz > nr_loc) return 1;
  int val = c[poz].ct_vot;
  int sum = 0;
  if (nr_cand == nr_loc && (c[poz].ct_vot > 0 || nr_cet > nr_vot)) return 0;
  for (int i = poz + 1; i <= min(nr_loc + 1, nr_cand); i++) {
    int dif = val - c[i].ct_vot + 1;
    sum += dif;
  }
  if (nr_cet - nr_vot < sum) return 0;
  return 1;
}
bool cmp(candidat a, candidat b) {
  if (a.ct_vot == b.ct_vot) return a.ap < b.ap;
  return a.ct_vot > b.ct_vot;
}
int main() {
  cin >> nr_cand >> nr_loc >> nr_cet >> nr_vot;
  vector<int> viz;
  viz.assign(nr_cand + 1, 1);
  int ap[101] = {0};
  for (int i = 1; i <= nr_vot; i++) {
    int x;
    cin >> x;
    viz[x]++;
    ap[x] = i;
  }
  int ct = 0;
  for (int i = 1; i <= nr_cand; i++) {
    if (viz[i] != 0) {
      c[++ct].ind = i;
      c[ct].ap = ap[i];
      c[ct].ct_vot = viz[i] - 1;
    }
  }
  sort(c + 1, c + ct + 1, cmp);
  int sol[101];
  for (int i = 1; i <= nr_cand; i++) {
    if (canWin(i)) {
      if (canLose(i))
        sol[c[i].ind] = 2;
      else
        sol[c[i].ind] = 1;
    } else
      sol[c[i].ind] = 3;
  }
  for (int i = 1; i <= nr_cand; i++) cout << sol[i] << " ";
  return 0;
}
