#include <bits/stdc++.h>
using namespace std;
int v[105], lst[105];
int main() {
  int n, k, m, a;
  scanf("%d%d%d%d", &n, &k, &m, &a);
  for (int i = 1; i <= a; i++) {
    int x;
    scanf("%d", &x);
    v[x]++;
    lst[x] = i;
  }
  m -= a;
  for (int i = 1; i <= n; i++) {
    int up = 0, vt = v[i] + m;
    if (vt == 0) {
      printf("3 ");
      continue;
    }
    for (int j = 1; j <= n; j++) {
      if (i == j) continue;
      if (v[j] > vt || (v[j] == vt && (m || lst[i] > lst[j]))) up++;
    }
    if (up >= k) {
      printf("3 ");
      continue;
    }
    if (v[i] == 0) {
      printf("2 ");
      continue;
    }
    up = 0;
    priority_queue<int> pq;
    for (int j = 1; j <= n; j++) {
      if (i == j) continue;
      if (v[j] > v[i] || (v[j] == v[i] && lst[j] < lst[i]))
        up++;
      else
        pq.emplace(v[j] - v[i] - 1);
    }
    int mm = m;
    while (!pq.empty() && up < k && mm > 0) {
      mm += pq.top();
      pq.pop();
      up++;
    }
    if (up >= k && mm >= 0)
      printf("2 ");
    else
      printf("1 ");
  }
}
