#include <bits/stdc++.h>
using namespace std;
const int N = 200;
struct po {
  int cnt, t, num;
  bool operator<(const po b) const {
    return (cnt > b.cnt) || (cnt == b.cnt && t < b.t);
  }
} b[N];
int sum[N];
int ans[N];
int main() {
  int n, k, m, a;
  scanf("%d%d%d%d", &n, &k, &m, &a);
  for (int i = 1; i <= n; i++) b[i].num = i;
  for (int i = 1; i <= a; i++) {
    int x;
    scanf("%d", &x);
    b[x].cnt++;
    b[x].t = i;
  }
  sort(b + 1, b + n + 1);
  for (int i = n; i > 0; i--) sum[i] = b[i].cnt + sum[i + 1];
  m -= a;
  if (m == 0) {
    for (int i = 1; i <= k; i++)
      if (b[i].cnt)
        ans[b[i].num] = 1;
      else
        ans[b[i].num] = 3;
    for (int i = k + 1; i <= n; i++) ans[b[i].num] = 3;
  } else {
    int flag = 0;
    for (int i = 1; i <= k; i++)
      if (b[i].cnt) {
        if ((b[i].cnt + 1) * (k - i + 1) - sum[i + 1] + sum[k + 2] <= m &&
            k != n)
          ans[b[i].num] = 2;
        else
          ans[b[i].num] = 1;
      } else
        ans[b[i].num] = 2, flag = 1;
    if (flag)
      for (int i = k + 1; i <= n; i++) ans[b[i].num] = 2;
    else
      for (int i = k + 1; i <= n; i++)
        if (b[k].cnt + 1 - b[i].cnt <= m)
          ans[b[i].num] = 2;
        else
          ans[b[i].num] = 3;
  }
  for (int i = 1; i <= n; i++) printf("%d ", ans[i]);
  return 0;
}
