#include <bits/stdc++.h>
using namespace std;
struct node {
  int val, id, end;
} mat[105];
int t[105], n, m, k, a;
bool cmp(node x, node y) {
  if (x.val == y.val) return x.end < y.end;
  return x.val > y.val;
}
int main() {
  scanf("%d%d%d%d", &n, &k, &m, &a);
  for (int i = 1; i <= n; i++) mat[i].id = i;
  for (int i = 1; i <= a; i++) {
    int x;
    scanf("%d", &x);
    mat[x].val++;
    mat[x].end = i;
  }
  sort(mat + 1, mat + n + 1, cmp);
  for (int i = 1; i <= n; i++) {
    int t1 = m - a, sum = i - 1;
    for (int j = i + 1; j <= n; j++) {
      int x = mat[i].val - mat[j].val + 1;
      if (x > t1) break;
      t1 -= x;
      sum++;
    }
    if (sum < k && mat[i].val) {
      t[mat[i].id] = 1;
      continue;
    }
    sum = 0;
    mat[i].val += m - a;
    for (int j = 1; j <= n; j++)
      if (i != j && mat[j].val >= mat[i].val) sum++;
    if (sum >= k || mat[i].val == 0)
      t[mat[i].id] = 3;
    else
      t[mat[i].id] = 2;
    mat[i].val -= m - a;
  }
  for (int i = 1; i <= n; i++) printf("%d ", t[i]);
  return 0;
}
