#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
const int inf = (int)1e9 + 5;
const long long MAXN = 300005;
const long long MAXVAL = 10000000;
const long long INF = (long long)1e17 + 50;
const long long MOD = (long long)1e9 + 7;
const unsigned long long HASH_MOD = 2305843009213693951;
void fail(string failMessage = "Impossible") {
  cout << failMessage;
  exit(0);
};
struct SegTree {
 private:
  long long n;
  vector<long long> t;
  long long get_min(long long v, long long tl, long long tr, long long l,
                    long long r) {
    if (l > r) return INF;
    if (l == tl && r == tr) return t[v];
    long long tm = (tl + tr) / 2;
    long long m1 = get_min(v * 2, tl, tm, l, min(r, tm));
    long long m2 = get_min(v * 2 + 1, tm + 1, tr, max(l, tm + 1), r);
    return min(m1, m2);
  }
  void update(long long v, long long tl, long long tr, long long pos,
              long long val) {
    if (tl == tr) {
      t[v] = val;
      return;
    }
    long long tm = (tl + tr) / 2;
    if (pos <= tm)
      update(v * 2, tl, tm, pos, val);
    else
      update(v * 2 + 1, tm + 1, tr, pos, val);
    t[v] = min(t[v * 2], t[v * 2 + 1]);
  }

 public:
  SegTree(long long size) {
    n = size;
    t.resize(4 * n, INF);
  }
  long long get_min(long long l, long long r) {
    return get_min(1, 0, n - 1, l, r);
  }
  void update(long long pos, long long val) { update(1, 0, n - 1, pos, val); }
};
void solve() {
  long long n, k, m, curm;
  cin >> n >> k >> m >> curm;
  long long x;
  vector<long long> g(curm);
  vector<long long> count(n, 0), last(n, -1);
  for (long long i = 0; i < curm; i++) {
    cin >> g[i];
    g[i]--;
    count[g[i]]++;
    last[g[i]] = i;
  }
  vector<long long> r(n);
  for (long long i = 0; i < n; i++) {
    count[i] += (m - curm);
    long long plast = last[i];
    if (m != curm) last[i] = m - 1;
    long long place = 1;
    for (long long j = 0; j < n; j++) {
      if (i != j && count[j] > count[i] ||
          count[j] == count[i] && last[j] < last[i])
        place++;
    }
    if (place > k || count[i] == 0) {
      r[i] = 3;
    }
    count[i] -= (m - curm);
    last[i] = plast;
  }
  for (long long i = 0; i < n; i++) {
    if (r[i] == 3) continue;
    vector<long long> copy_count = count;
    vector<long long> copy_last = last;
    for (long long j = curm; j < m; j++) {
      long long min_diff = inf, ind = -1;
      for (long long k = 0; k < n; k++) {
        if (i == k) continue;
        if (count[i] > count[k] || count[i] == count[k] && last[i] < last[k]) {
          if (count[i] - count[k] < min_diff) {
            min_diff = count[i] - count[k];
            ind = k;
          }
        }
      }
      if (ind == -1) break;
      count[ind]++;
      last[ind] = j;
    }
    long long place = 1;
    for (long long j = 0; j < n; j++) {
      if (i != j && count[j] > count[i] ||
          count[j] == count[i] && last[j] < last[i])
        place++;
    }
    if (place <= k && count[i] > 0)
      r[i] = 1;
    else
      r[i] = 2;
    count = copy_count;
    last = copy_last;
  }
  for (auto e : r) cout << e << " ";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.precision(15);
  solve();
  (void)0;
  return 0;
}
