#include <bits/stdc++.h>
using namespace std;
const int N = 200200;
const int mod = 1e9 + 7;
int cnt[N], last[N];
vector<pair<pair<int, int>, int> > V;
int n, m, k, a;
inline int solve(int x) {
  V.clear();
  for (int i = 1; i <= n; i++) {
    V.push_back(make_pair(make_pair(-cnt[i], last[i]), i));
  }
  sort(V.begin(), V.end());
  pair<int, int> P = make_pair(1000, 1000);
  int canadd = m - a;
  int tt = 10000;
  bool one = true;
  for (int i = 0; i < V.size(); i++) {
    if (V[i].second == x) {
      P = V[i].first;
    } else {
      if (P == make_pair(1000, 1000)) {
        continue;
      } else {
        while (canadd && V[i].first > P) {
          V[i].first.first--;
          V[i].first.second = tt;
          tt++;
          canadd--;
        }
      }
    }
  }
  sort(V.begin(), V.end());
  for (int i = 0; i < V.size(); i++) {
    if (V[i].second == x && V[i].first.first != 0) {
      if (i < k) {
        return 1;
      }
    }
  }
  V.clear();
  for (int i = 1; i <= n; i++) {
    V.push_back(make_pair(make_pair(-cnt[i], last[i]), i));
  }
  if (m - a) {
    V[x - 1].first.first -= m - a;
    V[x - 1].first.second = tt;
  }
  sort(V.begin(), V.end());
  for (int i = 0; i < V.size(); i++) {
    if (V[i].second == x) {
      if (V[i].first.first == 0) {
        return 3;
      }
      if (i < k) {
        return 2;
      }
    }
  }
  return 3;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k >> m >> a;
  for (int i = 1; i <= a; i++) {
    int x;
    cin >> x;
    cnt[x]++;
    last[x] = i;
  }
  for (int i = 1; i <= n; i++) {
    cout << solve(i) << " ";
  }
  return 0;
}
