#include <bits/stdc++.h>
using namespace std;
int ROW[] = {+1, -1, +0, +0};
int COL[] = {+0, +0, +1, -1};
int X[] = {+0, +0, +1, -1, -1, +1, -1, +1};
int Y[] = {-1, +1, +0, +0, +1, +1, -1, -1};
int KX[] = {-2, -2, -1, -1, 1, 1, 2, 2};
int KY[] = {-1, 1, -2, 2, -2, 2, -1, 1};
vector<int> basePrime = {1009, 1013, 1019, 1021, 1031, 1223, 1229, 1231, 1237,
                         1249, 1289, 1291, 1297, 1301, 1303, 353,  359,  367,
                         373,  379,  859,  863,  877,  881,  883,  1931, 1933,
                         1949, 1951, 1973, 401,  409,  419,  421,  431,  1709,
                         1721, 1723, 1733, 1741, 3499, 3511, 3517, 3527, 3529,
                         929,  937,  941,  947,  953};
template <class XXX>
XXX GCD(XXX a, XXX b) {
  return b == 0 ? a : GCD(b, a % b);
}
template <class XXX>
XXX LCM(XXX a, XXX b) {
  return a * (b / GCD(a, b));
}
bool CMP(long long int a, long long int b) { return a > b; }
template <class XXX>
void fastread(XXX &number) {
  bool negative = false;
  register XXX c;
  number = 0;
  c = getchar();
  if (c == '-') {
    negative = true;
    c = getchar();
  }
  for (; (c > 47 && c < 58); c = getchar()) number = number * 10 + c - 48;
  if (negative) number *= -1;
}
template <class XXX>
inline XXX moduler(XXX num, XXX mod) {
  return (num >= mod ? num -= mod : num);
}
inline int Set(int pos, int N) { return N = N | (1 << pos); }
inline int Reset(int pos, int N) { return N = N & ~(1 << pos); }
inline bool Check(int pos, int N) { return (bool)(N & (1 << pos)); }
void OPFILE() {}
struct info {
  int candidate, votes, last;
};
bool cmp(info a, info b) {
  if (a.votes != b.votes) return a.votes > b.votes;
  return a.last < b.last;
}
int main() {
  OPFILE();
  int n, k, m, a;
  cin >> n >> k >> m >> a;
  vector<pair<int, int> > cnt(n + 5, {0, 0});
  for (int i = 1; i <= a; i++) {
    int x;
    cin >> x;
    cnt[x].first++;
    cnt[x].second = i;
  }
  vector<info> pq;
  pq.push_back({10000007, 10000007, 10000007});
  for (int i = 1; i <= n; i++) {
    pq.push_back({i, cnt[i].first, cnt[i].second});
  }
  sort(pq.begin(), pq.end(), cmp);
  int ans[n + 5], left = m - a;
  memset(ans, 0, sizeof(ans));
  for (int i = 1; i <= k; i++) {
    if (pq[i].votes == 0) break;
    int cnt = 0;
    for (int j = i + 1; j <= k + 1 and j <= n; j++)
      cnt += pq[i].votes - pq[j].votes + 1;
    if (cnt <= left and k + 1 <= n) {
      ans[pq[i].candidate] = 2;
      break;
    } else
      ans[pq[i].candidate] = 1;
  }
  for (int i = 1; i <= n; i++) {
    if (ans[pq[i].candidate] == 1) continue;
    if (pq[i].votes + (m - a) > pq[k].votes and pq[i].votes + (m - a) > 0)
      ans[pq[i].candidate] = 2;
    else
      ans[pq[i].candidate] = 3;
  }
  for (int i = 1; i <= n; i++) {
    if (i > 1) cout << ' ';
    cout << ans[i];
  }
  puts("");
  return 0;
}
