#include <bits/stdc++.h>
using namespace std;
typedef struct Candidate {
  int num;
  int votes;
  int lastCand;
} Candidate;
pair<int, int> votes[110];
Candidate votesCopy[110];
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 checkIs1(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 checkIs3(int candNum, int leftVote, int k) {
  int candVote = votes[candNum].first;
  if (candVote + leftVote > votesCopy[k].votes) {
    return false;
  } else if (leftVote == 0 && candVote == votesCopy[k].votes) {
    if (candVote == 0) {
      return true;
    }
    if (votes[candNum].second <= votesCopy[k].lastCand) {
      return false;
    }
  }
  if (candNum == votesCopy[k].num && (candVote + leftVote > 0)) {
    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;
    scanf("%d", &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 (checkIs3(i, left, k)) {
      printf("3 ");
    } else if (votes[i].first != 0 && checkIs1(i, left, k, n)) {
      printf("1 ");
    } else {
      printf("2 ");
    }
  }
}
