#include <bits/stdc++.h>
using namespace std;
long double eps = 1e-5;
const long double pi = acos(-1.0);
const long long inf = 1e+9;
const long long inf64 = inf * inf;
#pragma comment(linker, "/STACK:36777216")
template <typename T>
istream &operator>>(istream &, vector<T> &);
template <typename T>
ostream &operator<<(ostream &, const vector<T> &);
int m;
int twoOrThree(const vector<pair<int, int> > &g, int id, int cnt, int k) {
  int n = g.size();
  vector<pair<pair<int, int>, int> > a(n);
  for (int i = 0; i < n; i++) {
    if (i == id) {
      a[i] = make_pair(make_pair(g[i].first + cnt, -(m - 1)), i);
    } else
      a[i] = make_pair(g[i], i);
  }
  sort(a.rbegin(), a.rend());
  for (int i = 0; i < k; i++) {
    if (a[i].second == id) {
      if (a[i].first.first != 0)
        return 2;
      else
        return 3;
    }
  }
  return 3;
}
bool superMan(const vector<pair<int, int> > &g, int id, int cnt, int k) {
  int n = g.size();
  vector<pair<pair<int, int>, int> > a(n);
  for (int i = 0; i < n; i++) a[i] = make_pair(g[i], i);
  sort(a.rbegin(), a.rend());
  int pos = -1;
  int val = -1;
  for (int i = 0; i < n; i++) {
    if (a[i].second == id) {
      pos = i;
      val = a[i].first.first;
    }
  }
  int up = pos;
  for (int i = pos + 1; i < n; i++) {
    int need = val + 1 - a[i].first.first;
    if (cnt >= need) {
      cnt -= need;
      up++;
    }
  }
  if (up >= k)
    return false;
  else
    return true;
}
void solve() {
  int n, k, a;
  scanf("%d %d %d %d", &n, &k, &m, &a);
  vector<pair<int, int> > g(n);
  for (int i = 0; i < a; i++) {
    int x;
    scanf("%d", &x);
    x--;
    g[x].first++;
    g[x].second = -i;
  }
  vector<int> ans(n);
  for (int i = 0; i < n; i++) {
    ans[i] = twoOrThree(g, i, m - a, k);
  }
  for (int i = 0; i < n; i++) {
    if (superMan(g, i, m - a, k) && g[i].first != 0) ans[i] = 1;
  }
  for (int i = 0; i < n; i++) cout << ans[i] << " ";
  cout << endl;
}
int main() {
  cout.setf(ios::fixed);
  cout.precision(19);
  solve();
  return 0;
}
template <typename T>
istream &operator>>(istream &is, vector<T> &v) {
  for (int i = 0; i < v.size(); ++i) is >> v[i];
  return is;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  for (int i = 0; i < v.size(); ++i) os << v[i] << " ";
  return os;
}
