#include <bits/stdc++.h>
using namespace std;
int K, N, M, A;
int g[110], ind[110], last[110], rnk[110];
struct data {
  int x, y;
} a[110];
bool cmp(data X, data Y) {
  if (X.x == Y.x) {
    return last[X.y] < last[Y.y];
  }
  return X.x > Y.x;
}
int main() {
  int i, j, k;
  cin >> N >> K >> M >> A;
  for (i = 0; i < A; i++) {
    cin >> g[i];
    ind[g[i]]++;
    last[g[i]] = i + 1;
  }
  for (i = 1; i <= N; i++) a[i].x = ind[i], a[i].y = i;
  sort(a + 1, a + N + 1, cmp);
  for (i = 1; i <= N; i++) {
    rnk[a[i].y] = i;
    if (ind[a[i].y] == 0) rnk[a[i].y] = K + 1;
  }
  for (i = 1; i <= N; i++) {
    if (rnk[i] <= K) {
      if (K == N) {
        cout << "1 ";
        continue;
      }
      int cnt = 0;
      for (j = rnk[i] + 1; j <= K + 1; j++) {
        cnt += (ind[i] - ind[a[j].y] + 1);
      }
      if (cnt <= M - A)
        cout << 2 << " ";
      else
        cout << 1 << " ";
    } else {
      if (ind[i] + (M - A) > ind[a[K].y])
        cout << 2 << " ";
      else
        cout << 3 << " ";
    }
  }
}
