#include <bits/stdc++.h>
using namespace std;
const int N = 1e2 + 10;
int n, k, m, a;
int ans[N], C[N];
bool fre[N];
struct Item {
  int r, i, id;
  Item() {}
  Item(int r, int i, int id) : r(r), i(i), id(id) {}
  bool operator<(const Item &that) const {
    return r > that.r || (r == that.r && i < that.i);
  }
} I[N];
int main() {
  scanf("%d%d%d%d", &n, &k, &m, &a);
  for (int i = 1; i <= n; ++i) I[i].id = i;
  for (int i = 1; i <= a; ++i) {
    int v;
    scanf("%d", &v);
    I[v].r++;
    I[v].i = i;
    C[v]++;
  }
  if (k == n) {
    int vote = m - a;
    if (vote == 0) {
      for (int i = 1; i <= n; ++i)
        if (C[i] == 0)
          printf("%d ", 3);
        else
          printf("%d ", 1);
    } else {
      for (int i = 1; i <= n; ++i)
        if (C[i] == 0)
          printf("%d ", 2);
        else
          printf("%d ", 1);
    }
    return 0;
  }
  sort(I + 1, I + n + 1);
  int vote = m - a;
  int totVote = 0;
  for (int i = 1; i <= k + 1; ++i) totVote += I[i].r;
  for (int i = 1; i <= k; ++i) {
    int r = I[i].r, id = I[i].id;
    totVote -= r;
    if (I[i].r == 0) {
      if (vote == 0)
        ans[id] = 3;
      else
        ans[id] = 2;
    } else {
      if (totVote + vote >= (r + 1) * (k - i + 1))
        ans[id] = 2;
      else
        ans[id] = 1;
    }
    fre[id] = true;
  }
  for (int i = 1; i <= n; ++i)
    if (fre[i] == false) {
      if (C[i] + (m - a) > I[k].r)
        ans[i] = 2;
      else
        ans[i] = 3;
    }
  for (int i = 1; i <= n; ++i) printf("%d ", ans[i]);
  return 0;
}
