#include <bits/stdc++.h>
using namespace std;
struct El {
  int cnt;
  int last;
  int id;
  bool operator<(const El& other) const {
    if (cnt != other.cnt) {
      return cnt > other.cnt;
    }
    if (last != other.last) {
      return last < other.last;
    }
    return id < other.id;
  }
};
int main() {
  int n, k, m, a;
  scanf("%d %d %d %d", &n, &k, &m, &a);
  vector<int> votes(a);
  vector<El> cand(1 + n);
  for (int i = 1; i <= n; ++i) {
    cand[i] = {0, 0, i};
  }
  for (int i = 0; i < a; ++i) {
    scanf("%d", &votes[i]);
    ++cand[votes[i]].cnt;
    cand[votes[i]].last = i;
  }
  vector<int> res(1 + n);
  for (int i = 1; i <= n; ++i) {
    auto ch = cand;
    int rem = m - a;
    for (int j = 0; j < rem; ++j) {
      ++ch[i].cnt;
      ch[i].last = a + j;
    }
    sort(ch.begin() + 1, ch.end());
    int pos = -1;
    for (int j = 1; j <= n; ++j) {
      if (ch[j].id == i) {
        pos = j;
        break;
      }
    }
    assert(pos != -1);
    if (pos > k || ch[pos].cnt == 0) {
      res[i] = 3;
      continue;
    }
    ch = cand;
    sort(ch.begin() + 1, ch.end());
    pos = -1;
    for (int j = 1; j <= n; ++j) {
      if (ch[j].id == i) {
        pos = j;
        break;
      }
    }
    assert(pos != -1);
    rem = m - a;
    int add = 0;
    for (int j = pos + 1; j <= n; ++j) {
      while (add < rem && ch[pos] < ch[j]) {
        ++ch[j].cnt;
        ch[j].last = a + add;
        ++add;
      }
    }
    sort(ch.begin() + 1, ch.end());
    pos = -1;
    for (int j = 1; j <= n; ++j) {
      if (ch[j].id == i) {
        pos = j;
        break;
      }
    }
    assert(pos != -1);
    if (ch[pos].cnt > 0 && pos <= k) {
      res[i] = 1;
    } else {
      res[i] = 2;
    }
  }
  for (int i = 1; i <= n; ++i) {
    printf("%d ", res[i]);
  }
  puts("");
  return 0;
}
