#include <bits/stdc++.h>
using namespace std;
const int MAXN = 110;
typedef struct Candidate {
  int num;
  int votes;
  int lastCand;
} Candidate;
pair<int, int> votes[MAXN];
Candidate votesCopy[MAXN];
bool cmp(Candidate a, Candidate b) {
  if (a.votes > b.votes) {
    return true;
  } else if (a.votes == b.votes) {
    return a.lastCand < b.lastCand;
  } else {
    return false;
  }
}
bool canWin(int candNum, int leftVote, int k, int n) {
  int candVote = votes[candNum].first;
  int order = 0;
  for (int i = 1; i <= n; i++) {
    if (votesCopy[i].num == candNum) {
      order = i;
      break;
    }
  }
  int overs = 0;
  int endIdx = order + 1;
  while (endIdx <= n && leftVote > 0) {
    int diff = candVote - votesCopy[endIdx].votes + 1;
    if (leftVote >= diff) {
      leftVote -= diff;
    } else {
      break;
    }
    endIdx++;
    overs++;
  }
  if (order + overs > k) {
    return false;
  }
  return true;
}
bool canLose(int candNum, int leftVote, int k, int n) {
  int candVote = votes[candNum].first;
  int order = 0;
  for (int i = 1; i <= n; i++) {
    if (votesCopy[i].num == candNum) {
      order = i;
      break;
    }
  }
  if (leftVote == 0) {
    if (candVote == 0) {
      return true;
    } else {
      if (order <= k) {
        return false;
      } else {
        return true;
      }
    }
  } else {
    if (candVote + leftVote > votesCopy[k].votes) {
      return false;
    }
  }
  return true;
}
int main() {
  int n, k, m, a;
  cin >> n >> k >> m >> a;
  for (int i = 1; i <= a; i++) {
    int num;
    cin >> num;
    votes[num].first++;
    votes[num].second = i;
  }
  for (int i = 1; i < 110; i++) {
    Candidate cand;
    cand.num = i;
    cand.votes = votes[i].first;
    cand.lastCand = votes[i].second;
    votesCopy[i] = cand;
  }
  sort(votesCopy + 1, votesCopy + n + 1, cmp);
  int left = m - a;
  for (int i = 1; i <= n; i++) {
    if (canLose(i, left, k, n)) {
      cout << "3 ";
    } else if (votes[i].first != 0 && canWin(i, left, k, n)) {
      cout << "1 ";
    } else {
      cout << "2 ";
    }
  }
}
