#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, k, m, a;
  cin >> n >> k >> m >> a;
  vector<int> tot(n), lst(n, -1);
  for (int i = 0; i < (a); ++i) {
    int g;
    cin >> g;
    --g;
    ++tot[g];
    lst[g] = i;
  }
  vector<pair<int, int> > ls(n);
  for (int i = 0; i < (n); ++i) ls[i] = {tot[i], -lst[i]};
  sort(ls.begin(), ls.end());
  reverse(ls.begin(), ls.end());
  if (m == a) {
    for (int i = 0; i < (n); ++i) {
      if (tot[i] && pair<int, int>(tot[i], -lst[i]) >= ls[k - 1])
        cout << 1 << ' ';
      else
        cout << 3 << ' ';
    }
  } else {
    if (k == n) {
      for (int i = 0; i < (n); ++i) {
        if (tot[i])
          cout << "1 ";
        else
          cout << "2 ";
      }
    } else {
      for (int i = 0; i < (n); ++i) {
        if (pair<int, int>(tot[i], -lst[i]) > ls[k]) {
          int j = 0;
          while (ls[j].second != -lst[i]) ++j;
          int cur = 0;
          for (int x = j + 1; x < (k + 1); ++x)
            cur -= -1 + ls[x].first - ls[j].first;
          if (cur > m - a)
            cout << "1 ";
          else
            cout << "2 ";
        } else {
          if (ls[k - 1].first - tot[i] + 1 > m - a)
            cout << "3 ";
          else
            cout << "2 ";
        }
      }
    }
  }
  cout << endl;
}
