#include <bits/stdc++.h>
struct candidat {
  int id, numberVotes, last;
};
bool compara(const candidat &x, const candidat &y) {
  if (x.numberVotes > y.numberVotes) {
    return 1;
  }
  if (x.numberVotes < y.numberVotes) {
    return 0;
  }
  if (x.numberVotes == y.numberVotes) {
    if (x.last < y.last) {
      return 1;
    } else {
      return 0;
    }
  }
}
bool canWin(int x, std::vector<candidat> cand, int m, int a, int k, int n) {
  if (cand[k].numberVotes < m - a + cand[x].numberVotes ||
      (x <= k && (m > a || cand[x].numberVotes > 0))) {
    return 1;
  } else {
    return 0;
  }
}
bool canLose(int x, std::vector<candidat> candi, int m, int a, int k, int n) {
  if (x > k || !candi[x].numberVotes) {
    return 1;
  }
  if (n - k == 0 && (candi[x].numberVotes || m > a)) {
    return 0;
  }
  int count = 0;
  for (int i = x + 1; i <= std::min(k + 1, n); i++) {
    count = count + 1 + candi[x].numberVotes - candi[i].numberVotes;
  }
  if (count > m - a) {
    return 0;
  }
  return 1;
}
int winORlose(int var1, int var2) {
  if (var1 && var2) {
    return 2;
  }
  if (var1 && !var2) {
    return 1;
  }
  return 3;
}
std::vector<int> countVotes(105, 1);
std::vector<int> last(105, 0);
int main() {
  int n, k, m, a;
  std::cin >> n >> k >> m >> a;
  std::vector<int> arr;
  for (int i = 0; i < a; i++) {
    int candidate;
    std::cin >> candidate;
    arr.push_back(candidate);
    last[candidate] = i;
    countVotes[candidate]++;
  }
  int cnt = 0;
  std::vector<candidat> candidates(105);
  for (int i = 1; i <= n; i++) {
    if (countVotes[i] > 0) {
      cnt++;
      candidat aux;
      aux.last = last[i];
      aux.id = i;
      aux.numberVotes = countVotes[i];
      aux.numberVotes--;
      candidates[cnt] = aux;
    }
  }
  sort(candidates.begin() + 1, candidates.begin() + cnt + 1, compara);
  std::vector<int> sol(105, 0);
  for (int i = 1; i <= n; i++) {
    int var1 = canWin(i, candidates, m, a, k, n);
    int var2 = canLose(i, candidates, m, a, k, n);
    sol[candidates[i].id] = winORlose(var1, var2);
  }
  for (int i = 1; i <= n; i++) {
    std::cout << sol[i] << " ";
  }
}
