#include <bits/stdc++.h>
using namespace std;
int n, k, m, a, num[105] = {0}, x[105], r[105] = {0};
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> k >> m >> a;
  for (int i = 1; i <= a; i++) {
    int t;
    cin >> t;
    r[t] = i;
    num[t]++;
  }
  for (int i = 1; i <= n; i++) {
    priority_queue<int> q;
    int cnt = 0, left = m - a;
    for (int j = 1; j <= n; j++) {
      if (i == j) continue;
      if (num[j] > num[i] || num[j] == num[i] && r[j] < r[i])
        cnt++;
      else
        q.push(num[j]);
    }
    while (!q.empty()) {
      int t = num[i] + 1 - q.top();
      q.pop();
      if (t <= left) {
        left -= t;
        cnt++;
      } else
        break;
    }
    if (cnt < k && num[i] != 0) {
      cout << 1 << " ";
      continue;
    }
    cnt = 0;
    num[i] += m - a;
    int rr = m == a ? r[i] : m;
    for (int j = 1; j <= n; j++) {
      if (i == j) continue;
      if (num[i] < num[j] || num[i] == num[j] && r[j] < rr) cnt++;
    }
    if (cnt < k && num[i] != 0) {
      cout << 2 << " ";
      num[i] -= m - a;
      continue;
    }
    num[i] -= m - a;
    cout << 3 << " ";
  }
  cout << endl;
  return 0;
}
